Repository navigation
Open
Labels
api-suggestion(1) Early API idea and discussion, it is NOT ready for implementationarea-controls-ListViewhelp wantedGood issue for external contributorsinvestigateItems we want to investigate before making a decision on an issuetenet-compatibility-OSCompatibility with OS features
Milestone
Description
State of Play
- Currently,
ListViewGrouponly supportsHeaderandHeaderAlignment(although this is buggy, see Cleanup LVGROUPW interop and fix HeaderAlignment refresh bugList view group tests #2555) - Our definition of
LVGROUPWis actually too small: LVGROUP actually exposes a lot more functionality (https://docs.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-lvgroup)

Missing Feature Parity
- See http://www.componentowl.com/better-listview.html
- See https://www.codeproject.com/Articles/16009/A-Much-Easier-to-Use-ListView-2
- See https://msdn.microsoft.com/en-gb/msdnmag/issues/07/08/WindowsCPP/default.aspx
Support For Images
- You can set the
LVSIL_GROUPHEADERlist view image list - You can set the
LVGF_TITLEIMAGEflag onmaskand setiTitleImageto a valid index into theLVSIL_GROUPHEADERimage list
This would add the following APIs to ListView and ListViewGroup:
public class ListView
{
...
public ImageList GroupHeaderImageList { get; set; }
...
}public class ListViewGroup
{
...
public int TitleImageIndex { get; set; }
...
}Collapsible
- Can set the
LVGF_STATEflag onuMaskand setstateMasktoLVGS_COLLAPSIBLEandstatetoLVGS_COLLAPSIBLE - https://www.codeproject.com/Articles/31276/Add-Group-Collapse-Behavior-on-a-Listview-Control
This would add the following APIs to ListViewGroup:
public class ListViewGroup
{
...
public bool Collapsible { get; set; }
...
}Discussion
- The rightmost collapse/expand icon doesn't work: to fix this we need to call
base.WndProcinWM_LBUTTONUPhandler
Collapsed
- Can set the
LVGF_STATEflag onuMaskand setstateMasktoLVGS_COLLAPSEDandstatetoLVGS_COLLAPSED
This would add the following APIs to ListViewGroup:
public class ListViewGroup
{
...
public bool Collapsed { get; set; }
...
}HeaderVisible
- Can set the
LVGF_STATEflag onuMaskand setstateMasktoLVGS_NOHEADERandstatetoLVGS_NOHEADER
This would add the following APIs to ListViewGroup:
public class ListViewGroup
{
...
public bool HeaderVisible { get; set; } = true;
...
}Description Top/Bottom
- You can set the
LVGF_DESCRIPTIONTOPflag onmaskand setpszDescriptionTopto a valid string andcchDescriptionTopto the length of the string - You can set the
LVGF_DESCRIPTIONBOTTOMflag onmaskand setpszDescriptionBottomto a valid string andcchDescriptionBottomto the length of the string
This would add the following APIs to ListViewGroup:
public class ListViewGroup
{
...
public string TopDescription { get; set; }
public string BottomDescription { get; set; }
...
}/cc @weltkante @RussKie
Reacted by kirsan31, Tobias Käs and Manfredi Marceca
Reacted by Igor Velikorossov
Metadata
Metadata
Assignees
Labels
api-suggestion(1) Early API idea and discussion, it is NOT ready for implementationarea-controls-ListViewhelp wantedGood issue for external contributorsinvestigateItems we want to investigate before making a decision on an issuetenet-compatibility-OSCompatibility with OS features





Activity
hughbe commentedon Jan 3, 2020
There are a lot more, I'm just putting this out here to see if there's interest! If so, I can work on fleshing out more and more features
weltkante commentedon Jan 3, 2020
Some of these certainly look interesting and I'd probably make use of them if they were available. I think this needs a process similar to the TaskDialog to design and review the API, though its probably a bit simpler.
If you don't have any immediate interest in driving this yourself I think its certainly worth keeping this up for grabs for someone who wants to get into contributing to the project.
hughbe commentedon Jan 3, 2020
I'd be interested in driving this, but lets make it up-for-grabs while we spell out desired functionality - perfectly happy for a collaborative effort. We can make it incremental, too
hughbe commentedon Jan 4, 2020
OK. Here's the list of missing features
LVGROUPthat will be covered in this:What I haven't included (so far)
iExtendedImage: I can't seem to get it to work and there's literally no documentation about it (http://www.vbforums.com/showthread.php?789187-ListView-Group-iTitleImage-and-iExtendedImage-alignment-and-text-and-view-modes)pszSubsetTitleorcchSubsetTitle: don't really know how subsetting works (from the docs: The creation of subsets is not currently supported, and pszSubsetTitle cannot be set by applications.)weltkante commentedon Jan 5, 2020
I assume you already tried setting an image list via
LVM_SETIMAGELISTforLVSIL_GROUPHEADER?I'd not add anything to the WinForms API which isn't covered by the docs, exposing undocumented functionality is always risky as it may not work on every OS version (needs extensive testing) or might break with updates.
I guess its kinda hard to decide what is considered "documented" for ListView considering documentation is very sparse, e.g. the "extended image" situation. I'd certainly leave something off though when it explicitely says its not supported.
RussKie commentedon Jan 6, 2020
Thank you for initiating the discussion. I have noticed the gap too while uplifting the ListView.
.NET Framework was really constrained by compat and, thus, it was near impossible to catch up with OS API updates. We have a significantly greater freedom for updates in .NET.
We are having internal discussions and I am pushing hard for a greater feature parity and alignment with OS features. And whilst the team may not get a mandate for an uplift, we are taking community contributions.
As a user I would have use for these features too in https://github.com/gitextensions/gitextensions, like many other WinForms .NET Framework projects we had to hack around missing features.
All significant additions like
TaskDialogwill undergo a significant scrutiny*, once new APIs are added they generally can't be changed.Bridging a gap should be significantly simpler exercise - for the most part APIs are established, adding few new properties and/or methods should be trivial as long as they belong to the established vocabulary and feel consistent with the rest.
Would you mind raising each as a separate issue?
Also would you mind adding your test harness app to the
WinformsControlsTestproject (stub out non implemented calls)?* Going OSS, migrating and porting .NET Framework, and delivering 3.x we weren't quite prepared for the
TaskDialogport. We're also doing it for the first time too.That's why it is taking way more time than it should (and reasonable). But we are near the end.
dreddy-work commentedon Feb 28, 2022
Winforms team agree to add this support and would welcome community contribution on this.