質問

Is there an easy way to convert an infragistics UltraGridRow to a standard DataRow object?

役に立ちましたか?

解決

If you have set the DataSource of your UltraGrid to a DataTable then you could extract the underlying DataRow of the current ActiveRow using

 if(grid.ActiveRow != null && grid.ActiveRow.IsDataRow)
 {
      DataRow row = (grid.ActiveRow.ListObject as DataRowView).Row;
 }

Of course you could subst the ActiveRow of this example with every UltraGridRow where the IsDataRow property is true (beware of the SummaryRows and the OutlookGroupByRow)

Notice that if you bind to the DataSource a List<CustomClass> then the ListObject is able to return the single instance of the CustomClass

他のヒント

If I remember correctly, you can access the underlying DataRow via:

var myDataRow = ((DataRowView)myUltraGridRow.ListObject).Row;

given the precondition that your grid.DataSource object is a DataTable or DataSet.

Use the ListObject property of the UltraGridRow to get at the underlying data item.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top