Hi,
is there a simple way to get the DataRow of an UltraGridRow, and vice versa?
(With DataRow, I mean the row containing the data shown in the UltraGridRow, when the DataSource property of the grid is set to a datatable of a dataset).
So far I could only find the other Row type if I looped through the table or the grid, I think this is not the most efficient way.
Best regards
When you bind to a DataTable, the UltraGridRow.ListObject property will return a DataRowView object, which in turn exposes a Row property; this property returns the associated DataRow.
To go the other way, the RowsCollection class (see UltraGrid.Rows) exposes a method, GetRowWithListIndex, which provides a way to get a reference to the UltraGridRow associated with the DataRow at the specified index.
Thank you!
Hi
Infragistics.Win.UltraWinGrid.CellEventArgs e;
If e is a CellEventsArgs then you can grab the DataRow as
((DataRowView)e.Cell.Row.ListObject).Row
And directely from the ultraGrid as
((DataRowView)someUltraGrid.Rows[index].ListObject).Row