# Cell Freezing

## Content



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](/componentone/api/maui/online-maui/dotnet-api/C1.Maui.Grid/C1.Maui.Grid.FlexGrid.FrozenRows.html) and [FrozenColumns](/componentone/api/maui/online-maui/dotnet-api/C1.Maui.Grid/C1.Maui.Grid.FlexGrid.FrozenColumns.html) properties of the [FlexGrid](/componentone/api/maui/online-maui/dotnet-api/C1.Maui.Grid/C1.Maui.Grid.FlexGrid.html) 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](https://cdn.mescius.io/document-site-files/images/4e85e507-742e-4a29-b3fe-f23b37c29164/images/freezing.gif)

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](/componentone/docs/maui/online-maui/maui-controls/flexgrid/flexgrid-quickstart) topic.

**xml**

```xml
<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>
```

**csharp**

```csharp
grid.FrozenRows = 2;
grid.FrozenColumns = 1;
grid.MinColumnWidth = 90;
```