Jump to content
softtouch

Listview and groups, any chance to have groups visible without items assigned?

Recommended Posts

I have a listview with groups and items. User can drag/drop items between groups. But when they move the last item of a group to another group, that group become invisible, so they cant move items back to that group.

Is there any way to keep groups visible at all time, even they have no items assigned to them?

Share this post


Link to post

Unfortunately no.  Empty groups are not displayed, that is simply how Microsoft implemented it.  So, the only option would be to add a blank item to the group just to keep it visible, and then remove that item later when it is no longer needed.

  • Like 1

Share this post


Link to post
55 minutes ago, Remy Lebeau said:

Unfortunately no.  Empty groups are not displayed, that is simply how Microsoft implemented it.  So, the only option would be to add a blank item to the group just to keep it visible, and then remove that item later when it is no longer needed.

Thanks for the hint with the blank item. Now I just need to find a way to hide the checkbox for that blank item.

Share this post


Link to post

Isn't it enough to just make it inaccessible?

Share this post


Link to post
1 minute ago, Stano said:

Isn't it enough to just make it inaccessible?

I just set DefaultDraw to false in onCustomDrawItem for that dummy item, and I have now the group header with an invisible item and no checkbox for that, so thats all fine so far.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×