WPF datagrid header text binding

后端 未结 9 2301
执念已碎
执念已碎 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条回答
  •  旧时难觅i
    2020-11-27 18:20

    I solved this by using the HeaderTemplate and binding to the DataContext of the DataGrid, using RelativeSource.

    
        
            
                
                    
                        
                    
                
            
        
    
    

    The same binding within the Header property did not work out.

提交回复
热议问题