WPF datagrid column heading span more than once column

后端 未结 6 584
轮回少年
轮回少年 2020-12-30 17:14

In a WPF datagrid is it possible to group column headings?

What I\'m after is

| Column 1 | Column 2 | Column 3|
| a  b  c  | a  b  c  | a  b  c |
|          


        
6条回答
  •  鱼传尺愫
    2020-12-30 17:43

    Here is how I did it, entirely in XAML.

    The width of the GD Column determins the width of each of the 4 columns, the UniformGrid sees to it that the columns are equal width. The TextBoxes stretch to full available width.

    The coloring of the DG Cell (=4 TextBoxes) is replaced by the coloring (MouseOver) of the individual textboxes.

    
        
            
                                      
                    
                    
                    
                    
                
                                    
         
    
    

提交回复
热议问题