private void LoadControlSpecs() { LvControls.Items.Clear(); foreach (MappedControl ctrl in _scannedTree.AllFormsControls) { ListViewItem lvi = new ListViewItem { Text = ctrl.CustomId, }; AddItems(ctrl, lvi); LvControls.Items.Add(lvi); } LvControls.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); }
private void LvControls_ColumnClick(object sender, ColumnClickEventArgs e) { if (_currentSortOrder == SortOrder.Ascending) { _currentSortOrder = SortOrder.Descending; } else { _currentSortOrder = SortOrder.Ascending; } ItemSorter it = new ItemSorter(e.Column, _currentSortOrder); LvControls.ListViewItemSorter = it; LvControls.Sort(); TsSortOrder.Text = @"Sorted Column: " + LvControls.Columns[e.Column].Text + @" Order:" + _currentSortOrder; }