WPF - How to bind a DataGridTemplateColumn

后端 未结 5 669
予麋鹿
予麋鹿 2021-02-05 07:07

I am trying to get the name of the property associated with a particular DataGridColumn, so that I can then do some stuff based on that. This function is called whe

5条回答
  •  一向
    一向 (楼主)
    2021-02-05 07:20

    Although you can't bind a template column, you can bind one of the controls held in that column. This is how I solved a similar problem:

    
         
               
                     
               
         
    
    

    If I've understood the initial example properly, this would mean changing the logic of the GroupByField_Click() method to check whether the sending column was a template column and then looking at the elements it contained to obtain the Binding object.

提交回复
热议问题