How to bind DataGridColumn.Visibility?

前端 未结 9 1920
悲哀的现实
悲哀的现实 2020-12-10 03:46

I have an issue similar to the following post:

Silverlight DataGridTextColumn Binding Visibility

I need to have a Column within a Silverlight DataGrid be vis

9条回答
  •  失恋的感觉
    2020-12-10 03:54

    From your MyDataGridTextColumn class, you could get the surrounding DataGrid. Then you get your ViewModel out of the DataContext of the DataGrid and add a handler to the PropertyChanged event of your ViewModel. In the handler you just check for the property name and its value and change the Visibility of the Column accordingly. Its not quite the best solution, but it should work ;)

提交回复
热议问题