WPF DataGrid GroupStyle

后端 未结 1 1299
遥遥无期
遥遥无期 2021-02-09 14:17

I have the following DataGrid in WPF with two groups.
First group is a bool flag which represents if a person is active/inactive.
The second group (or sub-g

1条回答
  •  清歌不尽
    2021-02-09 14:51

    I would highly recommend changing the data structure to:

    public class Person {
        public bool Active { get; set; }
        public int ID { get; set; }
        public string Name { get; set; }
    
        public Collection Cities { get; set; }
    }
    

    Otherwise you can change this GroupStyle

    
        
            
                
                    
                
            
        
    
    

    To

    
        
            
        
    
    

    Change the template to suit your needs

    0 讨论(0)
提交回复
热议问题