ComponentOne FlexPivot for WinForms
C1.Win.C1FlexGrid.4.5.2 Assembly / C1.Win.C1FlexGrid Namespace / IC1FlexGridRowDetail Interface / Setup Method
FlexGrid which displays detail control.
Index of parent detail row.
Example

In This Topic
    Setup Method (IC1FlexGridRowDetail)
    In This Topic
    Used to setup control before showing of it.
    Syntax
    '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.
    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.

    Example
    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; 
    }
    See Also