WPF DataGrid Hide selected row?
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.
精彩评论