Add support for tasks to ListViewGroup
See original GitHub issue- You can set the
LVGF_TASKflag onmaskand setpszTaskto a valid string andcchTaskto the length of the string
Proposed API
This would add the following APIs to ListView and ListViewGroup. I modelled these after the ColumnClick event args/handler/method
public delegate void GroupLinkClickEventHandler(object sender, GroupLinkClickEventArgs e);
public class GroupLinkClickEventArgs : EventArgs
{
public GroupLinkClickEventArgs(int column) { }
public int GroupLink { get; }
}
public class ListView
{
...
public event GroupLinkClickEventHandler GroupLinkClick { add; remove; }
protected void OnGroupLinkClick(GroupEventArgs e) { }
...
}
public class ListViewGroup
{
...
public string Task { get; set; }
...
}
Example
var listView = new ListView();
var group = new ListViewGroup
{
Task = "Task"
};
listView.Groups.Add(group);
listView.GroupLinkClick += (sender, e) => MessageBox.Show("Link Clicked");
E.g.

Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:14 (14 by maintainers)
Top Results From Across the Web
ListViewGroup Class (System.Windows.Forms)
ListView groups help your users find the items they are looking for by separating the items into useful categories. You can create whatever...
Read more >ListViewGroup.TaskLink Property (System.Windows.Forms)
The name of the task link displayed in the group header.
Read more >c# - Empty ListViewGroup is not shown in ListView
AddGroup , adding an item you can use of the listView.AddItem methods. This is opposed to listView.Items.Add and listView.Groups.Add methods.
Read more >Adding groups to ListView depending on the data in a list
I have written simple code which loops through a list object and create groups in ListView depending on the data in the list....
Read more >Create ListviewGroups Dynamically - PowerShell
There is a way to create dynamic groups ? In this example I have 2 computers, each line shows the disk partition of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

In my local implementation I went with the
LVN_LINKCLICK. Although this would add more structs to the internal interop, this is no harm - they’re not exposed and relatively simple.I agree
Example
LVN_CLICKEDinWndProcI agree as well