BLOG.CSHARPHELPER.COM: Use groups in a ListView control in C#
Use groups in a ListView control in C#
Many developers don't know that the ListView control can display items in groups.
To use groups, create them at either design or run time. Then add the items to the groups. If you add an item without specifying a group, it is displayed in a special "Default" group.
This program uses the following code to create two groups at run time.
// Add some groups to the ListView. ListViewGroup general_group = new ListViewGroup("General"); ListViewGroup vb_group = new ListViewGroup("Visual Basic Books"); lvwBooks.Groups.Add(general_group); lvwBooks.Groups.Add(vb_group);
It then adds items to the groups and adds one without a group. The following code shows how the program adds an item to the "General" group.
C# listview full source code
http://csharp.net-informations.com/gui/cs-listview.htm
Reply to this
good
Reply to this