Home Forums WinForms controls Xceed Grid for WinForms Master detail using collections Reply To: Master detail using collections

User (Old forums)
Post count: 23064

For the first problem, you are probably using the detail grid template instead of the detail grid instance of the master row where you want to add a new row. You can access the specific instance when the form is first loaded through the InitializingDetailGrid event, or thought the DetailGrids collection on the DataRow.


Xceed.Grid.DataRow detailRow = gridControl1.DataRows[0].DetailGrids[0].DataRows.AddNew();

As for the second problem, this is because there is probably no column in the collection when it is empty, so the grid cannot generate the corresponding columns. Either you make sure you always have something in the collection, or you can set the SynchronizeDetailGrids property on the GridControl to false.

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