Add a second Header Row to a DataGridView?

kkonkle

Newcomer
Joined
Feb 9, 2004
Messages
20
Location
Ann Arbor, MI
I have a grid I created that will have a series of 13 checkboxes and then information in the cells to the right of those checkboxes.

That is all set up and working, but to keep the checkbox columns a nice looking width I had to abbreviate the column headers down to one and two letters. It looks nice, but if you don't know what the headers are short for it is rather confusings.

I added tooltip popups for the checkbox columns, for easy reference, but my boss said another header row above the existing one that would help explain things would be helpful.

I've been googling for an hour and I found others who have posed this question, but noone ever received an answer.

So does anyone here know how to do this, or if it's possible or not?

Ideally I want a header row inserted above my existing header row, and I'd like some of the columns to span more than one column width.

Something that looks like this:

Code:
-------------------------------------------------------------
|     Brokerage     |     Direct   |      Client Data       |  //Header Row 1
-------------------------------------------------------------
| A | B | C | D | E | AA | BB | CC | First Name | Last Name |  //Header Row 2
-------------------------------------------------------------
| (Data rows)                                               |  //Data Rows Start Here
 
Personally I have found the built in grid can quickly become a stumbling block when a more customised UI is required - the feature may be doable but often looks substandard or takes far more effort than the end result seems to justify.

Depending on how badly this feature is required it may be worth investing in a 3rd party grid control that will give you far more control. A couple I have had previous experience with are http://www.infragistics.com/dotnet/netadvantage/winforms/wingrid.aspx#Overview and http://www.componentone.com/SuperProducts/FlexGridWinForms/ both of which have free evaluation versions.
 
Back
Top