We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Retrieving the underlying row source when the row index is known.

Hi again, I'm need to grab the DataRow used to populate a GDBG row. I have the list (range) info for the selected rows but am not sure of the syntax for mapping a grid row index to it's underlying datarow. Any suggestions? Thanks, Doug Lind

2 Replies

AD Administrator Syncfusion Team October 16, 2003 08:54 AM

To handle things like the grid being sorted or filtered, it best to go through the CurrencyManager. Here is some code. int pos = grid.Binder.RowIndexToPosition(rowIndex); CurrencyManager cm = (CurrencyManager) this.BindingContext[grid.DataSource, grid.DataMember]; DataRowView drv = (DataRowView) cm.List[pos]; DataRow dr = drv.Row;


DL Doug Lind October 16, 2003 08:58 AM

Mucho Garcia ;-) > To handle things like the grid being sorted or filtered, it best to go through the CurrencyManager. Here is some code. > > > int pos = grid.Binder.RowIndexToPosition(rowIndex); > CurrencyManager cm = (CurrencyManager) this.BindingContext[grid.DataSource, grid.DataMember]; > DataRowView drv = (DataRowView) cm.List[pos]; > DataRow dr = drv.Row; >

Loader.
Live Chat Icon For mobile
Up arrow icon