Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已将 DataGrid 绑定到我的集合,并且我需要将每行的高度绑定到我的属性。
可能吗?还是有另一种方法,将每行的高度与集合中的相应属性联系起来?
您可以Height在RowStyle.
Height
RowStyle
假设您有一个名为RowHeight
RowHeight
<DataGrid ItemsSource="{Binding ...}"> <DataGrid.RowStyle> <Style TargetType="DataGridRow"> <Setter Property="Height" Value="{Binding RowHeight}"/> </Style> </DataGrid.RowStyle> </DataGrid>