How add 2 header rows in listview c#

2.5k Views Asked by At

I want to add 2 header rows in list view like below:

   | ------------------------------|------------------|
   |        |      Set1            |      Set2        |    
   |--------| -------------------  |   ---------------|  
   | Name   | col1 col2 col3 col4  |   col5  col6 col7|
   | -------|----------------------|------------------|
   | item1  |   i1  i2   i3   i4   |    i5     i6  i7 |
   | item2  |   i8  i9   i10  i11  |    i12    i13 i14| 
   ---------------------------------------------------

How to achieve this?

1

There are 1 best solutions below

0
On

ListView control does not provide functionality for adding multiple header rows out of the box. To add multiple header rows you will need to handle some of ListView events or define new events and implement drawing of additional header-row yourself. There are number of examples on customizing appearance of grid and list controls:

  • Article about changing appearance of ListView control header
  • Thread about adding new header-row to DataGridView.