WPF datagrid header text binding

后端 未结 9 2295
执念已碎
执念已碎 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:37

    @mmichtch's answer works well for me, you just have to create a local namespace(xmlns), which contains reference to your project as follows:

    xmlns:local="clr-namespace:your_project_name"
    

    and along with it don't forget to mention the property you want to bind:

                    
                    
                        
                    
                
    

    it works well with VS 2010 and .net version 4.

提交回复
热议问题