Hack Forums
[.NET] [Source-VB.NET] ListView Grouping Example - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] [Source-VB.NET] ListView Grouping Example (/showthread.php?tid=1920303)

Pages: Pages 1 2


[Source-VB.NET] ListView Grouping Example - idb. - Nov 15, 2011

Was pretty sure I posted this up but I guess I didn't. This example shows ListView grouping and how to collapse/expand those groups. This uses the same class that I use in the example here: https://hackforums.net/showthread.php?tid=1740204

Anyhow, always liked the look of LV grouping. Very professional in my opinion. Hope someone can put some use to this. Some of the collapse/expand code comes from somewhere out the internets but I don't have a source at the moment to give credit to. Props to whoever that intelligent fellow was.

Screenshots:
Expanded groups:
[Image: Zutoc.png]

Collapsed groups:
[Image: TdXbF.png]

Source Code:
http://www.multiupload.com/GMPI37K3TO

Happy coding, fuckers. 😈


* - marvinn - Nov 15, 2011

Wow, if ppl dont know this.. Pff. But nice to see youu sharing it. Will be usefull to ther ppl (:


* - idb. - Nov 15, 2011

(Nov 15, 2011 03:37 AM)marvinn Wrote:  Wow, if ppl dont know this.. Pff. But nice to see youu sharing it. Will be usefull to ther ppl (:

It's not the actual grouping that people don't know... it's the collapse/expand of it. I added a screenshot of the collapsed groups so people know what I mean by that. Also, had to do some subclassing to supress the selection of all items in the group when the group header is clicked (I always thought that was annoying as shit). This is done inside of the NativeComponents class. Grouping is pretty beginner stuff though so def agree with you on that though. Either way... I'm pretty confident someone can put some use to this.


* - Tim Joe - Nov 15, 2011

Thanks this will be use full! Differently for my spotify song down loader


* - Reflexo - Nov 15, 2011

Thank you very much idb, now I know some more about the ListView Grouping Example!


* - .CRz - Nov 15, 2011

Awsome!

this is quality Post!

Thank you mate.




* - Penthos - Nov 15, 2011

HQ as ever idb ;)

Your shares are always epic. Im glad your apart of our community.

Much love ;)


* - Perplexity - Nov 15, 2011

I'll keep this for future reference, I may need to use this at some point.
Great work as always, Idb :3


* - SIM-701256 - Nov 15, 2011

Looks very nice, thank you for shareing this.


* - idb. - Nov 15, 2011

You're welcome guys :) Thanks for checking it out. Hope you can all put it to good use.


* - T3chN9n3 - Nov 15, 2011

Thank you very much for this share idb. Will make many GUI's look great in the future.

Also, I'm sure you are aware but if not to stop ListView from flickering when adding many items I found this out on the interwebs..

Quote:Using vb.net, I solved this in a slightly different way. I created a new class called ffListView, which looks like this:

Code:
Public Class ffListView
Inherits ListView

Public Sub New()
Me.DoubleBuffered = True
End Sub
End Class
Then I opened the .Designer.vb of my form and changed the initialization of my listview (which is called lvOutput) to the following:

Code:
Me.lvOutput = New ffListView
and that's all I had to do - no flicker of any sort.




* - idb. - Nov 15, 2011

(Nov 15, 2011 07:59 PM)T3chN9n3 Wrote:  Thank you very much for this share idb. Will make many GUI's look great in the future.

Also, I'm sure you are aware but if not to stop ListView from flickering when adding many items I found this out on the interwebs..

All that is handled already in the NativeComponents class :)


* - Fakedo0r - Feb 23, 2013

Sorry to revive old topics but the download link is down, can someone reupload? thanks in advance


* - pr3fix - Feb 23, 2013

(Feb 23, 2013 01:59 PM)Fakedo0r Wrote:  Sorry to revive old topics but the download link is down, can someone reupload? thanks in advance

You can do it yourself, here's s the example from MSND:
http://msdn.microsoft.com/en-us/library/ezh1batz.aspx

Adding items to a group is just as easy.


* - Fakedo0r - Feb 23, 2013

(Feb 23, 2013 02:25 PM)pr3fix Wrote:  You can do it yourself, here's s the example from MSND:
http://msdn.microsoft.com/en-us/library/ezh1batz.aspx

Adding items to a group is just as easy.

I know how use group items in listview. The IDB's example has collapsible group (customized listview). Thanks anyways.