Home Forums WinForms controls Xceed Grid for WinForms Master/Detail Issue Reply To: Master/Detail Issue

Xceed Support
Member
Post count: 5658

You can set AutoCreateColumns property (of the master grid) to false even if you have a detail grid. However, you need to add (to the master grid) a DataBoundColumn representing the “Relation” between the master and the detail grid.

<code>
gridControl1.AutoCreateColumns = false;

DataBoundColumn column1 = new DataBoundColumn( “PK” );
DataBoundColumn column2 = new DataBoundColumn( “Relation1” );

gridControl1.Columns.Add( column1 );
gridControl1.Columns.Add( column2 );
</code>

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