开发者

DevExpress create Dynamic grouping of columns

开发者 https://www.devze.com 2023-04-03 10:57 出处:网络
I have the following data structure: public class Person { public string Name{get;set;} public List<Finance>开发者_如何转开发; {get;set;}

I have the following data structure:

public class Person {
     public string Name{get;set;}
     public List<Finance>开发者_如何转开发; {get;set;}
}

public class Finance{
       public string Name{get;set;}
       public decimal GrossValue{get;set;}
       public decimal NettValue{get;set;}
}

Now I want to show the data in a grid as follows

Columns Name(From Person) Name(From Finance as a Group) Gross Value NettValue

Names Of People              Gross Value         NettValue

So it could possibly look like this:

 Name                           Jan                     Feb              Mar
                             Gross    Nett             Gross   Nett     Gross    Nett
   Joe                        100      50              1000    200        200     10
   Jill                      1000      900              450     11       2220      110

ETC...

Can this be done in DevExpress WinForms Grid if so how?

Thanks in advance


It could be done with an XtraGrid, but the approach would require unbound or calculated columns. The XtraPivotGrid control would usually be a better choice for this sort of thing.

0

精彩评论

暂无评论...
验证码 换一张
取 消