AD
Administrator
Syncfusion Team
February 26, 2005 12:00 AM UTC
The only way I would know to find the row in the grid is to loop through cm.List looking for the primary key value from the DataRow you are seeking.
//dr holds the DataRow to be found
string pkCol = "Col1";
CurrencyManager cm = (CurrencyManager)this.gridDataBoundGrid1.BindingContext[this.gridDataBoundGrid1.DataSource, this.gridDataBoundGrid1.DataMember];
int i = 0;
object pkValue = dr[pkCol];
foreach(DataRowView drv in cm.List)
{
if(drv[pkCol].Equals(pkValue))
break;
i++;
}
if(i < cm.List.Count)
{
int gridRowIndex = this.gridDataBoundGrid1.Binder.PositionToRowIndex(i);
Console.WriteLine("found at row {0}", gridRowIndex);
}