Windows Forms가 있고 내부에 UltraGrid 구성 요소가 있습니다.Winforms 용 Infragistics UltraGrid 컨트롤에서 인덱스를 기준으로 행을 삭제하려면 어떻게해야합니까?
숫자 인덱스를 사용하여 행을 삭제하려면 어떻게해야합니까? Infragistics의 설명서가 부족하고 관련 정보를 찾지 못하는 것 같습니다.
제안 사항?
Windows Forms가 있고 내부에 UltraGrid 구성 요소가 있습니다.Winforms 용 Infragistics UltraGrid 컨트롤에서 인덱스를 기준으로 행을 삭제하려면 어떻게해야합니까?
숫자 인덱스를 사용하여 행을 삭제하려면 어떻게해야합니까? Infragistics의 설명서가 부족하고 관련 정보를 찾지 못하는 것 같습니다.
제안 사항?
이 샘플 코드를 발견했습니다.
protected void wgSubstancesUsed_UpdateRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e)
{
switch (e.Row.DataChanged)
{
case Infragistics.WebUI.UltraWebGrid.DataChanged.Added:
this.InsertRecord(e.Row);
break;
case Infragistics.WebUI.UltraWebGrid.DataChanged.Modified:
this.UpdateRecord(e.Row);
break;
case Infragistics.WebUI.UltraWebGrid.DataChanged.Deleted:
this.DeleteRecord(e.Row);
break;
}
}
private void DeleteRecord(UltraGridRow theGridRow)
{
//Get the GUID of the record you wish to delete from the grid (for me
// the first hidden field of the grid
Guid thePrimaryKey = new Guid(theGridRow.Cells[0].Value.ToString());
if (thePrimaryKey != null)
{
busClientObject oClient = new busClientObject()
oClient.Load(thePrimaryKey); //Get to the individual record, load it into the object
oClient.DataRow.Delete(); //Mark that record for deletion
oClient.Save(); //Actually delete it
}
}
또한이 기사
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=7384
http://forums.infragistics.com/forums/p/24697/90536.aspx
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=7384
나는 WinGrid가 바인딩 목록에서 항목을 제거 추천하고이 것 좀 봐 그리드에서 제거하십시오. 목록의 항목 색인을 알고 있으면 RemoveAt 메서드를 사용하여 목록에서 목록의 항목을 제거 할 수 있습니다.
제거 할 UltraGridRow 개체에 대한 참조가있는 경우 UltraGridRow의 ListObject 속성에서 전달하는 Remove 메서드를 사용하여 목록의 Remove 메서드에 사용할 수 있습니다.
앨런