开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜