WPF datagrid header text binding

后端 未结 9 2292
执念已碎
执念已碎 2020-11-27 18:01

The column header of the DataGrid is not a FrameWork element for some reason, and so you cannot use bindings to set things like the header text. Please correct me if that is

9条回答
  •  囚心锁ツ
    2020-11-27 18:42

    an even better solution would be to set the binding in the header's style and pass the column as the header's dataContext... (or even better: to set up an object representing the header's dataContext and pass it)

    see there for a way to do this :

    How to set the DataContext on a DataGrid Column Header

提交回复
热议问题