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
close icon

Finding a row in GDBG

Hi How can i find a row in the GDBG for a specified criteria. Thanks Tom

1 Reply

AD Administrator Syncfusion Team December 10, 2005 12:34 AM UTC

The most effiecient way is to directly access the DataSource. Here is some code that assumes you are using a DataTable as the DataSource. If you are using an IList, replace the DataRowView in the code below with the class type of the objects in your list.
CurrencyManager cm = grid.BindingContext[grid.DataSource, grid.Datamember] as CurrencyManager;
int rowIndex = -1;
for(int position = 0; position < cm.List.Count; ++position)
{
	DataRowView drv = cm.List[position] as DataRowView;
	if(drv["Col1''].Equals(25))
	{
		rowIndex = grid.Binder.PositionToRowIndex(position);
		break;
	}
}
//rowindex is the grid row index where Col1 has 25 in it.

Loader.
Live Chat Icon For mobile
Up arrow icon