Alex Rivera | Logout

Grouping DataGridview in c# Winforms

Asked 2010-08-20T10:31:02.113
9

Hi I have the following data in datagridview in c# winforms:


Column A | Column B | Column C | Group

 Register 1  |       10,00     |       15,00 | Group 1
 Register 2  |       10,00     |       15,00 | Group 1
 Register 3  |       10,00     |       15,00 | Group 2
 Register 4  |       10,00     |       15,00 | Group 2

I want to get this in the following form:


Column A | Column B | Column C

Group 1
Register 1 | 10,00 | 15,00
Register 2 | 10,00 | 15,00
Group 1
Register 3 | 10,00 | 15,00
Register 4 | 10,00 | 15,00

I dont want to use multiple datagridviews

Edit
Report

1 Answer

5

The built-in WinForms DGV does not support grouping. Here is an article where someone has added this functionality themselves (note that I have not used this myself and so am not making a recommendation): http://blogs.vbcity.com/hotdog/archive/2008/12/19/9226.aspx

Alternately there are countless third-party DGV controls for sale. Infragistics has an excellent one that I can recommend which does provide grouping: http://www.infragistics.com/dotnet/netadvantage/winforms/wingrid.aspx#Overview

answered 2010-08-20T15:04:41.973

Your Answer