Skip to content

Discussion/Proposal: more ListViewGroup functionality #2623

Open

Description

@hughbe

State of Play

Missing Feature Parity

Support For Images

  • You can set the LVSIL_GROUPHEADER list view image list
  • You can set the LVGF_TITLEIMAGE flag on mask and set iTitleImage to a valid index into the LVSIL_GROUPHEADER image 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; }
    ...
}

E.g.
image

Collapsible

This would add the following APIs to ListViewGroup:

public class ListViewGroup
{
    ...
    public bool Collapsible { get; set; }
    ...
}

E.g.
Screen Recording 2020-01-03 at 08 10 pm

Discussion

  • The rightmost collapse/expand icon doesn't work: to fix this we need to call base.WndProc in WM_LBUTTONUP handler

Collapsed

  • Can set the LVGF_STATE flag on uMask and set stateMask to LVGS_COLLAPSED and state to LVGS_COLLAPSED

This would add the following APIs to ListViewGroup:

public class ListViewGroup
{
    ...
    public bool Collapsed { get; set; }
    ...
}

E.g.
Screen Recording 2020-01-04 at 06 57 pm

HeaderVisible

  • Can set the LVGF_STATE flag on uMask and set stateMask to LVGS_NOHEADER and state to LVGS_NOHEADER

This would add the following APIs to ListViewGroup:

public class ListViewGroup
{
    ...
    public bool HeaderVisible { get; set; } = true;
    ...
}

E.g.
Screen Recording 2020-01-04 at 07 05 pm

Description Top/Bottom

  • You can set the LVGF_DESCRIPTIONTOP flag on mask and set pszDescriptionTop to a valid string and cchDescriptionTop to the length of the string
  • You can set the LVGF_DESCRIPTIONBOTTOM flag on mask and set pszDescriptionBottom to a valid string and cchDescriptionBottom to 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; }
    ...
}

E.g.
image

/cc @weltkante @RussKie

Activity

  1. hughbe commented on Jan 3, 2020

    @hughbe
    ContributorAuthor

    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

  2. weltkante commented on Jan 3, 2020

    @weltkante
    Contributor

    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.

  3. hughbe commented on Jan 3, 2020

    @hughbe
    ContributorAuthor

    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

  4. hughbe commented on Jan 4, 2020

    @hughbe
    ContributorAuthor

    OK. Here's the list of missing features LVGROUP that will be covered in this:

    What I haven't included (so far)

  5. weltkante commented on Jan 5, 2020

    @weltkante
    Contributor

    Anything surrounding iExtendedImage: I can't seem to get it to work and there's literally no documentation about it

    I assume you already tried setting an image list via LVM_SETIMAGELIST for LVSIL_GROUPHEADER?

    from the docs: The creation of subsets is not currently supported

    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.

  6. RussKie commented on Jan 6, 2020

    @RussKie
    Contributor

    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.

    I'd be interested in driving this

    I think this needs a process similar to the TaskDialog to design and review the API, though its probably a bit simpler.

    All significant additions like TaskDialog will 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.

    Here's the list of missing features LVGROUP that will be covered in this

    Would you mind raising each as a separate issue?

    Also would you mind adding your test harness app to the WinformsControlsTest project (stub out non implemented calls)?


    * Going OSS, migrating and porting .NET Framework, and delivering 3.x we weren't quite prepared for the TaskDialog port. 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.

  7. added
    api-suggestion
    tenet-compatibility-OS
    on Jan 6, 2020
  8. added this to the Future milestone on Jan 6, 2020
  9. added
    help wanted
    on Jan 6, 2020
  10. dreddy-work commented on Feb 28, 2022

    @dreddy-work
    Member

    Winforms team agree to add this support and would welcome community contribution on this.

  11. ghost removed this from the Future milestone on Feb 28, 2022
  12. added this to the Future milestone on Feb 28, 2022
  13. added
    help wanted
    and removed
    help wanted
    on May 5, 2022
  14. ghost removed this from the Future milestone on May 5, 2022
  15. ghost added this to the Up-for-grabs milestone on May 5, 2022
  16. added
    investigate
    on Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api-suggestionarea-controls-ListViewhelp wantedinvestigatetenet-compatibility-OS

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions