SuperManSL
SuperManSL

Reputation: 1306

Adding button to listview group header

I have C# ListView with groups that are collapsible from codeproject.com

now I would like to have click event triggered on group header click. I've read that this is not possible but that some kind of link can be added to group header?

I need to get KEY (id) of clicked group.

If this is even possible.

Upvotes: 1

Views: 2076

Answers (1)

Grammarian
Grammarian

Reputation: 6882

ObjectListView adds lots of abilities to a standard ListView, including events when a ListViewGroup is clicked or expanded. Even if you don't want to use it, you can look at the code to see how it is done (it's a little complicated).

This blog describes what was need to add hit tests et al for ListViewGroups.

ObjectListView also has the ability to add a clickable link into the group header (this recipe shows how). For example "Check bank balace" and "Open calendar" in this screenshot:

Groups with clickable links

Upvotes: 1

Related Questions