Home Forums WinForms controls Xceed Grid for WinForms Add rows to Detail Grid Reply To: Add rows to Detail Grid

User (Old forums)
Member
Post count: 23064

Can’t seem to be able to access the detail grid’s contents.

In the master grid, I can check for selected rows, or run through all of the datarows:
foreach (Xceed.Grid.DataRow row in MyGrid.SelectedRows)
or
foreach (Xceed.Grid.DataRow row in MyGrid.DataRows)
Depending on which I choose, I can either return the value of the first cell in just the row selected, or all of the rows in the grid.

When I try in the detail grid, I can only code for all of the rows.
foreach (Xceed.Grid.DataRow row in MyDetailGrid.DataRows)
Then, I have to check to see if the row is selected
if (row.IsSelected)
{
MessageBox.Show(row.Cells[“cell1”].Value.ToString());
}

I never receive a value.

As a test, I did a MessageBox.Show to return the detail grid’s dataRow Count. It returned 0 every time.

Not sure if I have to call the selected row in the Parent Grid before iterating through the detail grid, and if so, how to code it.

Imported from legacy forums. Posted by KenG (had 462 views)