2011-07-29 5 views

답변

1

이 샘플 코드를 발견했습니다.

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

2

나는 WinGrid가 바인딩 목록에서 항목을 제거 추천하고이 것 좀 봐 그리드에서 제거하십시오. 목록의 항목 색인을 알고 있으면 RemoveAt 메서드를 사용하여 목록에서 목록의 항목을 제거 할 수 있습니다.

제거 할 UltraGridRow 개체에 대한 참조가있는 경우 UltraGridRow의 ListObject 속성에서 전달하는 Remove 메서드를 사용하여 목록의 Remove 메서드에 사용할 수 있습니다.

앨런

관련 문제