1 write to _selectedColumns
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
476
_selectedColumns
= new ListBox();
107 references to _selectedColumns
System.Windows.Forms.Design (107)
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (107)
99
_selectedColumns
.SelectedIndex = _columnsPrivateCopy.IndexOf((DataGridViewColumn)e.Element!);
100
ListBoxItem lbi = (ListBoxItem)
_selectedColumns
.SelectedItem!;
112
Debug.Assert(
_selectedColumns
.SelectedItem == item, "we must have lost track of what item is in the property grid");
123
int selectedIndex =
_selectedColumns
.SelectedIndex;
126
_selectedColumns
.Focus();
127
ActiveControl =
_selectedColumns
;
132
ListBoxItem listBoxItem = (ListBoxItem)
_selectedColumns
.SelectedItem;
143
_selectedColumns
.Items.RemoveAt(selectedIndex);
144
_selectedColumns
.Items.Insert(selectedIndex, new ListBoxItem(newColumn!, this, newColumnDesigner));
164
_selectedColumns
.SelectedIndex = selectedIndex;
165
_propertyGrid1.SelectedObject =
_selectedColumns
.SelectedItem;
288
if (e.Component is ListBoxItem &&
_selectedColumns
.Items.Contains(e.Component))
460
[MemberNotNull(nameof(
_selectedColumns
))]
522
resources.ApplyResources(
_selectedColumns
, "selectedColumns");
523
_selectedColumns
.DrawMode = DrawMode.OwnerDrawFixed;
524
_selectedColumns
.Margin = new Padding(0, 2, 3, 3);
525
_selectedColumns
.Name = "selectedColumns";
526
_overarchingTableLayoutPanel.SetRowSpan(
_selectedColumns
, 2);
527
_selectedColumns
.SelectedIndexChanged += selectedColumns_SelectedIndexChanged;
528
_selectedColumns
.KeyPress += selectedColumns_KeyPress;
529
_selectedColumns
.DrawItem += selectedColumns_DrawItem;
530
_selectedColumns
.KeyUp += selectedColumns_KeyUp;
543
_overarchingTableLayoutPanel.Controls.Add(
_selectedColumns
, 0, 1);
662
int selectedIndex =
_selectedColumns
.SelectedIndex;
663
Debug.Assert(selectedIndex > -1 && selectedIndex <
_selectedColumns
.Items.Count - 1);
668
ListBoxItem? item = (ListBoxItem)
_selectedColumns
.SelectedItem!;
669
_selectedColumns
.Items.RemoveAt(selectedIndex);
670
_selectedColumns
.Items.Insert(selectedIndex + 1, item);
701
_selectedColumns
.SelectedIndex = selectedIndex + 1;
702
_moveUp.Enabled =
_selectedColumns
.SelectedIndex > 0;
703
_moveDown.Enabled =
_selectedColumns
.SelectedIndex <
_selectedColumns
.Items.Count - 1;
708
int selectedIndex =
_selectedColumns
.SelectedIndex;
714
ListBoxItem item = (ListBoxItem)
_selectedColumns
.Items[selectedIndex - 1];
715
_selectedColumns
.Items.RemoveAt(selectedIndex - 1);
716
_selectedColumns
.Items.Insert(selectedIndex, item);
745
_selectedColumns
.SelectedIndex = selectedIndex - 1;
746
_moveUp.Enabled =
_selectedColumns
.SelectedIndex > 0;
747
_moveDown.Enabled =
_selectedColumns
.SelectedIndex <
_selectedColumns
.Items.Count - 1;
752
if (
_selectedColumns
.SelectedIndex != -1 &&
_selectedColumns
.TopIndex >
_selectedColumns
.SelectedIndex)
754
_selectedColumns
.TopIndex =
_selectedColumns
.SelectedIndex;
761
for (int i = 0; i <
_selectedColumns
.Items.Count; i++)
763
ListBoxItem? lbi =
_selectedColumns
.Items[i] as ListBoxItem;
805
_selectedColumns
.SelectedIndex = Math.Min(0,
_selectedColumns
.Items.Count - 1);
807
_moveUp.Enabled =
_selectedColumns
.SelectedIndex > 0;
808
_moveDown.Enabled =
_selectedColumns
.SelectedIndex <
_selectedColumns
.Items.Count - 1;
809
_deleteButton.Enabled =
_selectedColumns
.Items.Count > 0 &&
_selectedColumns
.SelectedIndex != -1;
810
_propertyGrid1.SelectedObject =
_selectedColumns
.SelectedItem;
812
_selectedColumns
.ItemHeight = Font.Height + OWNERDRAWVERTICALBUFFER;
814
ActiveControl =
_selectedColumns
;
818
_selectedColumns
.Focus();
825
Debug.Assert(
_selectedColumns
.SelectedIndex != -1);
826
int selectedIndex =
_selectedColumns
.SelectedIndex;
834
_selectedColumns
.SelectedIndex = Math.Min(
_selectedColumns
.Items.Count - 1, selectedIndex);
836
_moveUp.Enabled =
_selectedColumns
.SelectedIndex > 0;
837
_moveDown.Enabled =
_selectedColumns
.SelectedIndex <
_selectedColumns
.Items.Count - 1;
838
_deleteButton.Enabled =
_selectedColumns
.Items.Count > 0 &&
_selectedColumns
.SelectedIndex != -1;
839
_propertyGrid1.SelectedObject =
_selectedColumns
.SelectedItem;
844
int insertIndex =
_selectedColumns
.SelectedIndex == -1 ?
_selectedColumns
.Items.Count :
_selectedColumns
.SelectedIndex + 1;
860
int selectedIndex =
_selectedColumns
.SelectedIndex;
863
for (int i = 0; i <
_selectedColumns
.Items.Count; i++)
865
ListBoxItem? lbi =
_selectedColumns
.Items[i] as ListBoxItem;
872
_selectedColumns
.Items.Clear();
878
_selectedColumns
.Items.Add(new ListBoxItem(_columnsPrivateCopy[i], this, columnDesigner));
881
_selectedColumns
.SelectedIndex = Math.Min(selectedIndex,
_selectedColumns
.Items.Count - 1);
885
if (
_selectedColumns
.Items.Count == 0)
903
int selectedIndex =
_selectedColumns
.SelectedIndex;
905
Rectangle bounds = new(0, selectedIndex *
_selectedColumns
.ItemHeight,
_selectedColumns
.Width,
_selectedColumns
.ItemHeight);
910
_selectedColumns
.Items[selectedIndex] =
_selectedColumns
.Items[selectedIndex];
917
_selectedColumns
.Invalidate(bounds);
924
ListBoxItem? listBoxItem =
_selectedColumns
.SelectedItem as ListBoxItem;
938
ListBoxItem? listBoxItem =
_selectedColumns
.SelectedItem as ListBoxItem;
954
ListBoxItem? listBoxItem =
_selectedColumns
.Items[e.Index] as ListBoxItem;
997
Brush backBrush = new SolidBrush(
_selectedColumns
.BackColor);
999
string columnName = ((ListBoxItem)
_selectedColumns
.Items[e.Index]).ToString();
1016
if (
_selectedColumns
.Focused)
1063
_propertyGrid1.SelectedObject =
_selectedColumns
.SelectedItem;
1066
_moveDown.Enabled =
_selectedColumns
.Items.Count > 0 &&
_selectedColumns
.SelectedIndex !=
_selectedColumns
.Items.Count - 1;
1067
_moveUp.Enabled =
_selectedColumns
.Items.Count > 0 &&
_selectedColumns
.SelectedIndex > 0;
1068
_deleteButton.Enabled =
_selectedColumns
.Items.Count > 0 &&
_selectedColumns
.SelectedIndex != -1;
1070
if (
_selectedColumns
.SelectedItem is not null)
1072
DataGridViewColumn column = ((ListBoxItem)
_selectedColumns
.SelectedItem).DataGridViewColumn;
1152
_propertyGrid1.SelectedObject =
_selectedColumns
.SelectedItem;
1158
for (int i = 0; i <
_selectedColumns
.Items.Count; i++)
1160
int itemWidth = TextRenderer.MeasureText(
_selectedColumns
.Items[i].ToString(),
_selectedColumns
.Font).Width;
1164
_selectedColumns
.HorizontalExtent = SelectedColumnsItemBitmap.Width + 2 * OWNERDRAWITEMIMAGEBUFFER + maxItemWidth + OWNERDRAWHORIZONTALBUFFER;