Is there a possiblity to hide DataGrid-rows through DataBinding:
If I have items of a BO or a ViewModel that have a visibilty-property, is there a possibility to declare a binding so that the row will be hidden if the property is set to invisible and vice versa?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
It should be possible to do it via RowStyle
. Something like this:
<DataGrid>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Visibility" Value="{Binding Visibility}" />
</Style>
</DataGrid.RowStyle>
</DataGrid>