public static void FillSubjectItems(this ListViewEx listView, IEnumerable <string> items, string groupName, Dictionary <string, string> domaims) { listView.Groups.Clear(); listView.Items.Clear(); ListViewGroup group = new ListViewGroup(groupName); listView.Groups.Add(group); listView.SuspendLayout(); foreach (KeyValuePair <string, string> kvp in domaims) { foreach (string each in items) { ListViewItem item = new ListViewItem(); item.Group = group; item.Text = each; if (item.Text == kvp.Key) { item.Tag = kvp.Value; listView.Items.Add(item); } } } listView.ResumeLayout(); listView.Refresh(); }
public static void FillItems(this ListViewEx listView, IEnumerable <string> items, string groupName) { listView.Groups.Clear(); listView.Items.Clear(); ListViewGroup group = new ListViewGroup(groupName); listView.Groups.Add(group); listView.SuspendLayout(); foreach (string each in items) { ListViewItem item = new ListViewItem(); item.Group = group; item.Text = each; listView.Items.Add(item); } listView.ResumeLayout(); listView.Refresh(); }
internal void RefreshListView() { listView.Refresh(); }