Home Forums WinForms controls Xceed Grid for WinForms CurrentRow Reply To: CurrentRow

Xceed Support
Member
Post count: 5658

Here is a short snippet of code that shows how to get the Value of a cell of the CurrentRow and how to know the Index of a Row (in this case, the CurrentRow):

<code>
if(gridControl1.CurrentRow!=null)
{
string value = ( ( Xceed.Grid.DataRow )gridControl1.CurrentRow ).Cells[ 0 ].Value.ToString();
int rowNumber = gridControl1.DataRows.IndexOf( ( Xceed.Grid.DataRow )gridControl1.CurrentRow );
}
</code>

Imported from legacy forums. Posted by CharlesB (had 515 views)