AD
Administrator
Syncfusion Team
February 4, 2004 10:02 AM UTC
You can get at the object in the grid row through the CurrencyManager.
CurrencyManager cm;
cm = this.BindingContext[grid.DataSource. grid.DataMember] as CurrencyManager;
int position = grid.Binder.RowIndexToPosition(rowIndex);
DataRowView drv;
drv = cm.List[position] as DataRowView;
This should work when the grid''s DataSource is a DataTable. You do not need to use the defaultview.
If you bind the same table to two grids, you would want to use two different bindingcontexts unless you want the current position in both grid to always be in sync. To make sure a grid has a different bindingcontext, you can use
grid.BindingContext = new BindingContext();