[]
        
(Showing Draft Content)

C1.Win.C1FlexGrid.IC1FlexGridRowDetail.Setup

Setup Method

Setup(C1FlexGrid, int)

Used to setup control before showing of it.

Declaration
void Setup(C1FlexGrid parentGrid, int rowIndex)
Parameters
Type Name Description
C1FlexGrid parentGrid

FlexGrid which displays detail control.

int rowIndex

Index of parent detail row.

Remarks

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.

Examples

The code below shows the basic implementation of Setup method for detail control derived from C1Label:

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; 
}