Listview Groups with icons

hermiod

Member
Joined
Mar 17, 2008
Messages
6
Programming Experience
1-3
Hello all

I've got a form that uses a listview to display data from a database in individual groups, using listviewgroups.
I would like to know, is it possible to add images to the header of each group.

So instead of just displaying the title of the group, it will display an image there too.
Have done some googling and not come up with anything useful.

Thanks in advance.
 
ListViewGroup class doesn't have a property for this, and OwnerDraw only let you draw items and column headers - so I would say no.
 

Don't know if I've misread them, but the links you posted seem to speak of using imagelists and applying the images to the listviewitems themselves, this isn't what I'm trying to do.

When I put the listview data in to groups. ie:

Numbers <-------Group Header
1
2
3
4
5

Letters <-------Group Header
A
B
C
D
E

I want to apply an image to the Group Headers so it appears as

<image> Numbers
1
2
3
4
5

<image> Letters
A
B
C
D
E

Unless I've misread them, the posted links would produce an output something like:

Numbers
<image> 1
<image> 2
<image> 3
<image> 4
<image> 5

Letters
<image> A
<image> B
<image> C
<image> D
<image> E
 
That means I misread things, sorry about that.

When you say 'Groups' i thought you Large/Small Icon (like a folder) which means each listview item would have it's own icon (different gorup, different icon)

What you mean is Listview in details view and each column (not group) having an icon in which that functionality is not built into the listview and you would have to inherit the Listview control and draw icons in yourself
 
Well that's new. I used listviews all the time in VS 2003 but I've only used it once in VS 2005, I didn't know they added that feature.

It seems MS snuck that very cool feature out.
I know a few programmers who have been working with .Net on a daily basis since it came out and didn't know it could do that. There are also very few topics regarding it on the net, so I don't think its a widely known feature. Really adds to the look of a listview though.

The icons aren't really essential, they were just a 'would be nice' option.

If I find an alternative to this, I will post it here.
 

Latest posts

Back
Top