# data-grid-rows-height-customization

> Data grid customizes the row height for rows with multi-line content using the QueryRowHeight event.

**Framework:** maui  **Component:** Grid  **Variant:** rows-height-customization

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/maui/data-grid-rows-height-customization.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.Maui.DataGrid
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/data-grid-rows-height-customization/DataGrid.xaml

```xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:grid="clr-namespace:Syncfusion.Maui.DataGrid;assembly=Syncfusion.Maui.DataGrid"
             x:Class="MAUI.Controls.DataGrid.RowsHeightCustomization.RowsHeightCustomizationView"
             Title="Data Grid - Rows Height Customization">

    <grid:SfDataGrid x:Name="dataGrid"
                     ItemsSource="{Binding Employees}"
                     AutoGenerateColumnsMode="None"
                     QueryRowHeight="OnQueryRowHeight"
                     ColumnWidthMode="Fill"
                     HeaderRowHeight="48"
                     RowHeight="48">
        <grid:SfDataGrid.Columns>
            <grid:DataGridNumericColumn Format="D"
                                        MappingName="EmployeeID"
                                        HeaderText="Employee ID" />
            <grid:DataGridTextColumn MappingName="Name"
                                      HeaderText="Name" />
            <grid:DataGridTextColumn MappingName="Designation"
                                     HeaderText="Designation" />
            <grid:DataGridTextColumn MappingName="Email"
                                     HeaderText="Email"
                                     ColumnWidthMode="Auto"/>
            <grid:DataGridTextColumn MappingName="Description"
                                     HeaderText="Description"
                                     LineBreakMode="WordWrap"
                                     Width="350"/>
        </grid:SfDataGrid.Columns>
    </grid:SfDataGrid>
</ContentPage>
```

### src/components/data-grid-rows-height-customization/DataGrid.xaml.cs

```cs
namespace MAUI.Controls.DataGrid.RowsHeightCustomization
{
    public partial class RowsHeightCustomizationView : ContentPage
    {
        public RowsHeightCustomizationView()
        {
            InitializeComponent();
            BindingContext = new RowsHeightCustomizationViewModel();
        }

        private void OnQueryRowHeight(object? sender, Syncfusion.Maui.DataGrid.DataGridQueryRowHeightEventArgs e)
        {
            if (e.RowIndex > 0)
            {
                e.Height = e.GetIntrinsicRowHeight(e.RowIndex);
                e.Handled = true;
            }
        }
    }
}
```
