开发者

WPF DataGrid Hide selected row?

开发者 https://www.devze.com 2023-01-20 10:08 出处:网络
Is there a way to \"hide\" the SelectedItem o开发者_运维问答f the DataGrid ? dataGrid.SelectedItem.Visibility = Visibility.Hidden

Is there a way to "hide" the SelectedItem o开发者_运维问答f the DataGrid ?

dataGrid.SelectedItem.Visibility = Visibility.Hidden


Setting the Visibility of "SelectedItem", as you have, would not change the grid - it would be changing the "SelectedItem" property value of the bound object for that SelectedItem, which is not going to affect the grid at all.

In order to change the grid row's visibility, you'll need to change it directly. You can retemplate the DataGrid to change how the selected row is displayed.

For details, see DataGrid Styles and Templates.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号