Changing ListView Column Header Graphic

D

djohnson

My listview will sort but I would like the column headers to contain up
or down arrows to indicate the sort direction. I have an image on the
column header, but I'm having a heck of a time figuring out how to
programmatically change it. I can't find the property. Someone
suggested it is impossible to change the column header index in .Net
and that native Win32 API calls have to be used. Is this true? Isn't
there a more straightforward way in .Net?
 
C

Claes Bergefall

djohnson said:
My listview will sort but I would like the column headers to contain up
or down arrows to indicate the sort direction. I have an image on the
column header, but I'm having a heck of a time figuring out how to
programmatically change it.

So how did you get the image there in the first place if you didn't do it
programatically?

I can't find the property. Someone
suggested it is impossible to change the column header index in .Net
and that native Win32 API calls have to be used. Is this true? Isn't
there a more straightforward way in .Net?

Have you tried ColumnHeader.ImageIndex?

/claes
 
D

djohnson

No I hadn't but it seems to be working fine. I'm new to this and
failed to notice member variables for my columns were automatically
created, so all I had to do in this case, ColumnName.ImageIndex=4;.
Much easier than I expected. Thanks.
 
D

djohnson

No I hadn't but it seems to be working fine. I'm new to this and
failed to notice member variables for my columns were automatically
created, so all I had to do in this case, ColumnName.ImageIndex=4;.
Much easier than I expected. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top