'Declaration
Sub Setup( _ ByVal parentGrid As C1FlexGrid, _ ByVal rowIndex As Integer _ )
void Setup( C1FlexGrid parentGrid, int rowIndex )
Parameters
- parentGrid
- FlexGrid which displays detail control.
- rowIndex
- Index of parent detail row.
'Declaration
Sub Setup( _ ByVal parentGrid As C1FlexGrid, _ ByVal rowIndex As Integer _ )
void Setup( C1FlexGrid parentGrid, int rowIndex )
This method can be used to setup data binding or other properties of the detail control.
The parameters of this method contain instance of parent C1FlexGrid and row index. The row index can be used to determine the right index of data object in grid data source.
void IC1FlexGridRowDetail.Setup(C1FlexGrid parentGrid, int rowIndex) { // initialize BindingSource object from parent grid's data source var bs = new BindingSource(parentGrid.DataSource as DataSet, "Employees"); // retrieve and assign right position of data object in the parent grid's data source bs.Position = parentGrid.Rows[rowIndex].DataIndex; // assign corresponding data field DataField = "Notes"; // assign setup BindingSource object as data source DataSource = bs; }