FlexGrid for WinForms | ComponentOne
C1.Win.FlexGrid Namespace / C1InputPanelRowDetail Class / Setup Method
FlexGrid which displays detail control.
Index of parent detail row.
Example

In This Topic
    Setup Method (C1InputPanelRowDetail)
    In This Topic
    Used to setup control before showing of it.
    Syntax
    'Declaration
     
    
    Public Overridable Sub Setup( _
       ByVal parentGrid As C1FlexGrid, _
       ByVal rowIndex As Integer _
    ) 
    public virtual void Setup( 
       C1FlexGrid parentGrid,
       int rowIndex
    )

    Parameters

    parentGrid
    FlexGrid which displays detail control.
    rowIndex
    Index of parent detail row.
    Remarks
    This method can be overridden in the derived class to apply custom setup behavior of C1InputPanelRowDetail control.
    Example
    The code below shows the removing unnecessary input component: The code below shows the adding and setup of new InputImage item:
    public override void Setup(C1FlexGrid parentGrid, int rowIndex)
    {
        // calling base implementation
        base.Setup(parentGrid, rowIndex);
        
        // store C1InputPanel items in the variable
        var items = C1InputPanel.Items;
        
        // remove label for third InputComponent
        items.RemoveAt(3);
        
        // remove third InputComponent
        items.RemoveAt(3);
    }
    public override void Setup(C1FlexGrid parentGrid, int rowIndex)
    {
        // calling base implementation
        base.Setup(parentGrid, rowIndex);
        
        // store C1InputPanel items in the variable
        var items = C1InputPanel.Items;
        
        // initialize new instance of InputImage
        var photoInputImage = new InputImage();
        
        // assign corresponding data field
        photoInputImage.DataField = "Photo";
        
        // assign C1Input data source as item data source
        photoInputImage.DataSource = C1InputPanel.DataSource;
        
        // assign new width width and height
        photoInputImage.Width = 150;
        photoInputImage.Height = 150;
        
        // place next items in the new column
        photoInputImage.Break = BreakType.Column;
        
        // insert InputImage into items collection at third position
        items.Insert(3, photoInputImage);
    }
    See Also