tags:

views:

34

answers:

3

Is there anyway to create a grouping GridView in c# Winforms. for example I have the following data coulmns:
Manager name : Number of reportees : Reporting Manager name : Designation

I want this to be grouped based on designation as follows:

Project Manager
Manager name : Number of reportees : Reporting Manager name

Associate Project Manager
Manager name : Number of reportees : Reporting Manager name

I have all the data in say Manager Collection.

A: 

I don't think you're missing any functions of the control that will do that for you, I think you need to find a way to use the controls you have to do what you want.

For example, from your 4-col grid, if they click on a cell with a designation 'project mgr', you can open/switch to your 3 col grid with all project manager details.

Beth
+1  A: 

I don't think the standard DataGridView will do what you want. Infragistics has an UltraGrid control that has support for "group by", which sounds like what you want, but their controls are not free.

CodeSavvyGeek
Every 3rd party component company that produces a grid will have this grouping feature built in. In fact, most have it annoyingly turned on by default. Besides Infragistics there is: DevExpress, Telerik, Exceed, Syncfusion and many more...
Paul Sasik
+1  A: 

The following post has provided with a great sample.

http://blogs.vbcity.com/hotdog/archive/2008/12/19/9226.aspx

Chinjoo