You can disable resizing the columns of a datagrid.
Is there a way to stop resizing the rowsheader Height
At this moment the user can resize the row Headers. Like this:
I want to disable this. So it should always look:
That's my RowHeaderTemplate
<DataGrid.RowHeaderTemplate>
<DataTemplate>
<DockPanel FlowDirection="LeftToRight" DataContext="{Binding Item,RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}">
<TextBlock Text="{Binding ZimmerNummer}" MinWidth="48" MaxWidth="48" />
</DockPanel>
</DataTemplate>
</DataGrid.RowHeaderTemplate>
That was my idea:
<DataGrid.RowHeaderStyle>
<Style TargetType="DataGridRowHeader">
<Setter Property="MaxHeight"
Value="55"/>
</Style>
</DataGrid.RowHeaderStyle>
But it was not work. That was the result:
Do someone know a Solution for that?
If you want to disable resizing on your DataGrid
then you can do something like this:
<DataGrid CanUserResizeColumns="False" CanUserResizeRows="False" .../>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With