MAUI | ComponentOne
Controls / FlexGrid / Cell Freezing
In This Topic
    Cell Freezing
    In This Topic

    FlexGrid allows you to freeze rows and columns so that they remain visible as the user scrolls through the grid. While working with large data sets in grid, it is convenient to keep some of the rows or/and columns locked in the view. You can do it by setting the count of rows and columns to be frozen using FrozenRows and FrozenColumns properties of the FlexGrid class. Frozen cells can be edited and selected as regular cells, exactly as in Excel. In addition, you can freeze rows and columns separately as well as simultaneously.

    The following GIF showcases how FlexGrid appears after freezing first column and first two rows.

    Freezing rows and columns in MAUI FlexGrid

    The following code example demonstrates how to freeze rows and columns in FlexGrid using the FrozenRows and FrozenColumns properties, respectively. This example uses the sample created in Quick Start topic.

    <c1:FlexGrid x:Name="grid" AutoGenerateColumns="False" FrozenRows="2" FrozenColumns="1" MinColumnWidth="90">
        <c1:FlexGrid.Columns>
            <c1:GridColumn Binding="FirstName" />
            <c1:GridColumn Binding="LastName" />
            <c1:GridColumn Binding="City" />
            <c1:GridColumn Binding="Country" />
            <c1:GridColumn Binding="Active" />
        </c1:FlexGrid.Columns>
    </c1:FlexGrid>
    
    grid.FrozenRows = 2;
    grid.FrozenColumns = 1;
    grid.MinColumnWidth = 90;