Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1104
The fastest way to get the DataRow of an UltraGridRow
posted

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

Parents
  • 69832
    Verified Answer
    Offline posted

    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.

  • 1104
    Offline posted in reply to Brian Fallon

    Thank you!

Reply Children
No Data