How set row height in MAUI DataGrid?

1 Answer 547 Views
DataGrid
Dmitry
Top achievements
Rank 1
Iron
Dmitry asked on 09 Feb 2022, 04:14 AM
MAUI DataGrid don't have row unit, only cell.
When i try apply template for cell then vertical alignment not working.
For column Name using template bellow. For Modified Date using default.
                        <telerikDataGrid:DataGridColumn.CellContentTemplate>
                            <DataTemplate>
                                <Label Text="{Binding fileName}" Style="{StaticResource PrimaryLabel}"
                                       HeightRequest="40"
                                       HorizontalOptions="Start" VerticalOptions="Center"
                                       VerticalTextAlignment="Center"
                                       />
                            </DataTemplate>
                        </telerikDataGrid:DataGridColumn.CellContentTemplate>

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 09 Feb 2022, 03:24 PM

Hi Dmitry,

The observed by you behavior is a bug in the Label control - it is not a behavior related to RadDataGrid. It has already been logged to MAUI and you can find it here.

One possible workaround I can suggest you is to place a Grid layout around the Label and to set the HeightRequest to it:

<DataTemplate>
    <Grid HeightRequest="40">
        <Label Text="{Binding fileName}"
                VerticalOptions="Center" />
    </Grid>
</DataTemplate>

I hope this information was helpful.

Regards,
Nasko
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
DataGrid
Asked by
Dmitry
Top achievements
Rank 1
Iron
Answers by
Nasko
Telerik team
Share this question
or