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

User (Old forums)
Post count: 23064

I’m not sure if I understand what you are trying to do, but if you want to retrieve the rows of a DetailGrid that is attached to a master grid row, you need to do something like this :

//first, fine the master grid row you want to use, for example
Xceed.Grid.DataRow row = gridControl1.DataRows[ 0 ];
//Xceed.Grid.DataRow row = ( Xceed.Grid.DataRow )gridControl1.CurrentRow;

//get the detail grid (if you have more then one detail grid, you can loop through the DetailGrids collection)
DetailGrid grid = row.DetailGrids[ 0 ];

//then retrieve the rows attached to this master grid row
foreach( Xceed.Grid.DataRow detailRow in grid.DataRows )
System.Diagnostics.Debug.WriteLine( .Cells[ 0 ].Value.ToString() );

Imported from legacy forums. Posted by André (had 4008 views)