Home Forums WinForms controls Xceed Grid for WinForms easy question – keeping track of row locations Reply To: easy question – keeping track of row locations

User (Old forums)
Member
Post count: 23064

The <b>DataRow</b>-class has a read-only <b>Index</b>-property. So you can get it, if the CurrentRow is a DataRow, like this:<code>int index = -1;
Xceed.Grid.DataRow dr = dg.CurrentRow as Xceed.Grid.DataRow;
if (dr != null) index = dr.Index;

if (index >= 0 && index < dg.DataRows.Count)
{
dr = dg.DataRows[index];
dg.CurrentRow = dr;
dr.BringIntoView();
}</code>

Imported from legacy forums. Posted by Tommy (had 291 views)