DashboardLayout for WinForms | ComponentOne
In This Topic
    Flow Layout
    In This Topic

    DashboardLayout allows you to set the layout type to flow layout using its LayoutType property of C1DashboardLayout class. This layout arranges its contents in horizontal or vertical flow direction. The flow direction of the contents can be specified by using the FlowDirection property which accepts the values from FlowDirection enumeration. The possible values for this enumeration are as follows:

    By default, the FlowDirection property is set to LeftToRight. Therefore, when a control is dragged on the flow layout, the newly created child container positions itself on the upper left corner. When you add more controls to the layout, child containers get created and placed in left to right direction. As soon as the width of DashboardLayout has exhausted, the child containers automatically get wrapped and shift to the next row. In case you do not want the child containers to wrap, you can set the value of the WrapContent property to False.

    In flow layout, the control allows you to stop laying the controls in a particular row and start from the new row using the SetFlowBreak property.

    Note that the flow layout reverses its flow direction in Right-to-Left (RTL) layouts i.e. when RightToLeft property is set to True.

    The following image shows controls arranged in flow layout with FlowDirection property set to RightToLeft.

    Flow layout

    The flow layout can be accessed with the help of the FlowLayoutControl property which returns an instance of FlowLayoutPanel class. This instance is used to set the properties of flow layout. The following code illustrates some of the properties of the flow layout:

    c1DashboardLayout1.LayoutType = LayoutType.Flow;
    c1DashboardLayout1.FlowLayoutControl.FlowDirection = FlowDirection.RightToLeft;
    c1DashboardLayout1.FlowLayoutControl.WrapContents = true;
    c1DashboardLayout1.FlowLayoutControl.SetFlowBreak((Control)c1DashboardLayout1.Items[0].ItemContainer, true);
    

    To create a dashboard using flow layout, refer Creating Dashboard with Flow Layout.