Triangle indicator of sort order in column header of listview cont

G

Guest

I have windows form with ListView control. The ListView control has few
columns which user can sort by clicking the column header.

I want the column header have the small triangle indicator of sort order.
How can I implement that?

Thanks
 
D

Dmytro Lapshyn [MVP]

Steve,

There seems to be no managed way of doing this. While the underlying HEADER
control has dedicated Windows messages for adding icons to the column
headers, the managed wrapper does not utilize this possibility. However, as
long as you are comfortable with the Common Controls API and P/Invoke, you
can add the icons in a way you'd do it in C++.

Well, unless you really want this exercise in P/Invoking, check out this
CodeProject article:

http://www.codeproject.com/cs/miscctrl/aa_listview.asp

for an advanced (and FREE!) version of the ListView control.
 
G

Guest

Dmytro thank you for your response,

You wrote: "However, as long as you are comfortable with the Common Controls
API and P/Invoke, you can add the icons in a way you'd do it in C++."

Could you provide at least sketchy description and/or code sample which
shows how to access header control from C# using "Common Controls API and
P/Invoke"

Thanks

Dmytro Lapshyn said:
Steve,

There seems to be no managed way of doing this. While the underlying HEADER
control has dedicated Windows messages for adding icons to the column
headers, the managed wrapper does not utilize this possibility. However, as
long as you are comfortable with the Common Controls API and P/Invoke, you
can add the icons in a way you'd do it in C++.

Well, unless you really want this exercise in P/Invoking, check out this
CodeProject article:

http://www.codeproject.com/cs/miscctrl/aa_listview.asp

for an advanced (and FREE!) version of the ListView control.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]


Steve said:
I have windows form with ListView control. The ListView control has few
columns which user can sort by clicking the column header.

I want the column header have the small triangle indicator of sort order.
How can I implement that?

Thanks
 
D

Dmytro Lapshyn [MVP]

Steve,

Sorry but this is unlikely - I did that for a commercial project. Still, if
you download the source code for the article I mentioned in my previous
post, I think you should be able to find similar examples there.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]


Steve said:
Dmytro thank you for your response,

You wrote: "However, as long as you are comfortable with the Common
Controls
API and P/Invoke, you can add the icons in a way you'd do it in C++."

Could you provide at least sketchy description and/or code sample which
shows how to access header control from C# using "Common Controls API and
P/Invoke"

Thanks

Dmytro Lapshyn said:
Steve,

There seems to be no managed way of doing this. While the underlying
HEADER
control has dedicated Windows messages for adding icons to the column
headers, the managed wrapper does not utilize this possibility. However,
as
long as you are comfortable with the Common Controls API and P/Invoke,
you
can add the icons in a way you'd do it in C++.

Well, unless you really want this exercise in P/Invoking, check out this
CodeProject article:

http://www.codeproject.com/cs/miscctrl/aa_listview.asp

for an advanced (and FREE!) version of the ListView control.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]


Steve said:
I have windows form with ListView control. The ListView control has few
columns which user can sort by clicking the column header.

I want the column header have the small triangle indicator of sort
order.
How can I implement that?

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