限制 DataGridTextColumn 的行高

Limit Height of rows for DataGridTextColumn

我有一个显示多行的 DataGridTextColumn。通常这些行是单行的,但现在我不得不添加一个描述列,其中包含多行的更多文本。这样我的行的高度就会改变。如何将行的高度限制为单个文本行。我可以 "MaxWidth" 但由于某些原因不能 "MaxHeight"。

<DataGrid.Columns>
<DataGridTextColumn Header="Header_Txt" Binding="{Binding Result.Header_Txt}" MaxWidth="200"/>
</DataGrid.Columns>

DataGridTextColumn 没有 MaxHeight 属性,但 DataGridCell 有。因此,为列设置 CellStyle

<DataGridTextColumn ...>
    <DataGridTextColumn.CellStyle>
        <Style TargetType="DataGridCell">
            <Setter Property="MaxHeight" Value="22"/>
        </Style>
    </DataGridTextColumn.CellStyle>
</DataGridTextColumn>

只需使用 RowHeight 属性

 <DataGrid RowHeight="22">