Adding different context menu for datagrid's header

前端 未结 2 1645
悲哀的现实
悲哀的现实 2021-01-15 05:23

I want to add a different context menu for my datagrid\'s header on WPF. How can I do that?

2条回答
  •  醉话见心
    2021-01-15 06:02

    You can create a Context Menu for your Data Grid Column Headers or for your Data Grid Rows using DataGrid.ColumnHeaderStyle or DataGrid.RowStyle, respectively. See example:

    
        
            
            
        
        
            
            
        
    
    
        
            
                
            
            
                
            
        
    
    

提交回复
热议问题