Home Forums WinForms controls Xceed Grid for WinForms Xceed grid bound to strongly typed dataset – how to access current row from the dataset? Reply To: Xceed grid bound to strongly typed dataset – how to access current row from the dataset?

User (Old forums)
Member
Post count: 23064

Only way I found seems to be to make an assumption about what the grid is bound to, as in:

            int rowIndex = ((Xceed.Grid.DataRow)gridControl1.CurrentRow).Index;
            MyStronglyTypedDataTableRow r = (MyStronglyTypedDataTableRow)myStronglyTypedDataSet.MyStronglyTypedDataTable.Rows[rowIndex];
            r.MyColumn = 33;

 

But what if the grid is bound to a DataView and we apply different RowFilters? Can’t use the same. I’m surprised there’s no easy way to do this. What I want is something like:

             MyStronglyTypedDataTableRow r =
(MyStronglyTypedDataTableRow)dataGrid1.CurrentRow;

which would work irrespective of whether the grid is bound to MyStronglyTypedDataTable or a DataView based upon it.

 

Imported from legacy forums. Posted by Jeremy (had 1021 views)