Posted 6 September 2021, 4:10 pm EST
Hi,
JFYI, FlexGrid containing row details uses RowWithDetails class to display parent row & the child row is displayed using DetailRow class.
So, you can get all the main rows from FlexGrid as follows:
foreach(var row in grid.Rows)
{
if (row is RowWithDetails)
{
// main row
}
}
And for selecting main rows you can set FlexGrid’s SelectedIndex as follows:
int selectionRowIndex = (int)num.Value;
if (selectionRowIndex < 0)
MessageBox.Show("Row index shouldn't be negative");
else if ((grid.Rows.Count / 2)-1 < selectionRowIndex)
MessageBox.Show("Entered value should less than the no. of main rows in grid");
else
grid.SelectedIndex = selectionRowIndex;
Please refer the attached sample for the same : FlexgridRowDetailsDemo.zip
Regards,
Nitin