Two rows in a grid column header

  • Thread starter Thread starter Andrew Chalk
  • Start date Start date
A

Andrew Chalk

How do I have my header of a DataGrid column on more than one line. For
instance, if the header is "Wurzle Gummage" how do I format it as:

Wurzle
Gummage

preferably with control of the row justification as well.

Many thanks
 
I was trying to solve this problem for a long time, trying different things and browsing through several message board with no luck

then I realized it was easier than I thought, all you have to do is to develop a windows user control, place a datagrid and set the ColumnHeaders property to false

Then you need to create a property to expose the datagrid within the control and you can use the form's paint event to draw the headers the way you want

Obviously if you want the grid to be sortable you need to do it yourself.
 
Back
Top