WinForm, HOW TO CREATE GROUP IN LISTVIEW/HOW TO ADD ITEMS INTO LISTVIEW GROUP
listView1.Columns.Add("HelloWorld");
listView1.Groups.Add(new ListViewGroup("Group #1", HorizontalAlignment.Left));
listView1.Groups.Add(new ListViewGroup("Group #2", HorizontalAlignment.Left));
listView1.Groups.Add(new ListViewGroup("Group #3", HorizontalAlignment.Left));
listView1.Items.Add("Hello1").Group = listView1.Groups[0];
listView1.Items.Add("Hello2").Group = listView1.Groups[0];
listView1.Items.Add("Hello3").Group = listView1.Groups[0];
listView1.Items.Add("Hello4").Group = listView1.Groups[1];
listView1.Items.Add("Hello5").Group = listView1.Groups[1];
listView1.Items.Add("Hello6").Group = listView1.Groups[1];
listView1.Items.Add("Hello7").Group = listView1.Groups[2];
listView1.Groups.Add(new ListViewGroup("Group #1", HorizontalAlignment.Left));
listView1.Groups.Add(new ListViewGroup("Group #2", HorizontalAlignment.Left));
listView1.Groups.Add(new ListViewGroup("Group #3", HorizontalAlignment.Left));
listView1.Items.Add("Hello1").Group = listView1.Groups[0];
listView1.Items.Add("Hello2").Group = listView1.Groups[0];
listView1.Items.Add("Hello3").Group = listView1.Groups[0];
listView1.Items.Add("Hello4").Group = listView1.Groups[1];
listView1.Items.Add("Hello5").Group = listView1.Groups[1];
listView1.Items.Add("Hello6").Group = listView1.Groups[1];
listView1.Items.Add("Hello7").Group = listView1.Groups[2];
Comments
Post a Comment