By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,818 Members | 1,381 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,818 IT Pros & Developers. It's quick & easy.

Triangle indicator of sort order in column header of listview cont

P: n/a
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
Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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" <St***@discussions.microsoft.com> wrote in message
news:EB**********************************@microsof t.com...
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


Nov 17 '05 #2

P: n/a
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 [MVP]" wrote:
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" <St***@discussions.microsoft.com> wrote in message
news:EB**********************************@microsof t.com...
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


Nov 17 '05 #3

P: n/a
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" <St***@discussions.microsoft.com> wrote in message
news:68**********************************@microsof t.com...
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 [MVP]" wrote:
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" <St***@discussions.microsoft.com> wrote in message
news:EB**********************************@microsof t.com...
>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



Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.