241 references to Columns
Accessibility_Core_App (1)
DataBindingExample.cs (1)
97listView1.Columns.Add(colName);
System.Windows.Forms (41)
System\Windows\Forms\Controls\ListView\ColumnHeader.cs (5)
126if (value < 0 || value > (ListView.Columns.Count - 1)) 133int[] colsOrder = new int[ListView.Columns.Count]; 139for (int i = 0; i < ListView.Columns.Count; i++) 141ColumnHeader hdr = ListView.Columns[i]; 460ListView.Columns.RemoveAt(index);
System\Windows\Forms\Controls\ListView\ListView.cs (22)
2205Columns[lvhi.iItem].Text); 2401for (int i = 0; i < Columns.Count; i++) 2403sumOfDisplayIndices += Columns[i].DisplayIndex; 2404Debug.Assert(Columns[i].DisplayIndex > -1 && Columns[i].DisplayIndex < Columns.Count, "display indices out of whack"); 2407int colsCount = Columns.Count; 2453Columns.Clear(); 3580if (View == View.Details && Columns.Count == 0) 3609if (View == View.Details && Columns.Count == 0) 3650ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(subItemIndex, Columns.Count); 3656if (Columns.Count == 0) 3865int[] indices = new int[Columns.Count]; 3866for (int i = 0; i < Columns.Count; i++) 3868ColumnHeader hdr = Columns[i]; 5063foreach (ColumnHeader columnHeader in Columns) 5327Columns[i].DisplayIndexInternal = indices[i]; 6181int from = Columns[header->iItem].DisplayIndex; 6199Columns[header->iItem]); 6214int[] indices = new int[Columns.Count]; 6215for (int i = 0; i < Columns.Count; i++) 6217ColumnHeader hdr = Columns[i];
System\Windows\Forms\Controls\ListView\ListView.ListViewAccessibleObject.cs (4)
40=> this.TryGetOwnerAs(out ListView? owningListView) ? owningListView.Columns.Count : base.ColumnCount; 173var columnHeaders = new IRawElementProviderSimple.Interface[owningListView.Columns.Count]; 176columnHeaders[i] = owningListView.Columns[i].AccessibilityObject; 328for (int i = 1; i < owningListView.Columns.Count; i++)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemDetailsAccessibleObject.cs (6)
23private int LastChildIndex => HasImage ? _owningListView.Columns.Count : _owningListView.Columns.Count - 1; 33? _owningListView.Columns[accessibleChildIndex - 1]._correspondingListViewSubItemIndex 34: _owningListView.Columns[accessibleChildIndex]._correspondingListViewSubItemIndex; 107for (int i = 0; i < _owningListView.Columns.Count; i++) 109if (_owningListView.Columns[i]._correspondingListViewSubItemIndex == subItemIndex)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemTileAccessibleObject.cs (2)
54|| _owningListView.Columns.Count <= index 109int subItemCount = Math.Min(_owningListView.Columns.Count, _owningItem.SubItems.Count);
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObject.cs (2)
53if (!_owningListView.FullRowSelect && index == ParentInternal.FirstSubItemIndex && _owningListView.Columns.Count > 1) 143? [_owningListView.Columns[Column].AccessibilityObject]
System.Windows.Forms.Design (5)
System\Windows\Forms\Design\ColumnHeaderCollectionEditor.cs (1)
66listview.Columns.Remove(column);
System\Windows\Forms\Design\ListViewActionList.cs (1)
25EditorServiceContext.EditValue(_designer, Component!, nameof(ListView.Columns));
System\Windows\Forms\Design\ListViewDesigner.cs (1)
36return lv.Columns;
System\Windows\Forms\Design\MaskDesignerDialog.cs (1)
159_listViewCannedMasks.Columns.AddRange(
System\Windows\Forms\Design\StyleEditorForm.cs (1)
306_columnsAndRowsListView.Columns.AddRange(
System.Windows.Forms.Design.Tests (2)
ListViewDesignerTests.cs (2)
17listView.Columns.Add("123"); 18listView.Columns.Add("abc");
System.Windows.Forms.Tests (179)
System\Windows\Forms\AccessibleObjects\ColumnHeader.ListViewColumnHeaderAccessibleObjectTests.cs (6)
46listView.Columns.Add(columnHeader); 61listView.Columns.Add(columnHeader); 75listView.Columns.Add(columnHeader); 78listView.Columns.Clear(); 89listView.Columns.Add(columnHeader); 92listView.Columns.Remove(columnHeader);
System\Windows\Forms\AccessibleObjects\ListVIew.ListViewAccessibleObjectTests.cs (23)
266listView.Columns.Add(new ColumnHeader()); 347listView.Columns.Add(new ColumnHeader()); 389listView.Columns.Add(new ColumnHeader()); 450listView.Columns.Add(new ColumnHeader()); 512listView.Columns.Add(new ColumnHeader()); 583listView.Columns.Add(new ColumnHeader()); 638listView.Columns.Add(new ColumnHeader()); 718listView.Columns.Add(new ColumnHeader()); 800listView.Columns.Add(new ColumnHeader()); 852listView.Columns.Add(new ColumnHeader()); 1149listView.Columns.Add(new ColumnHeader("Column 1") { Width = 70 }); 1150listView.Columns.Add(new ColumnHeader("Column 2") { Width = 70 }); 1172listView.Columns.Add(new ColumnHeader("Column 1") { Width = 70 }); 1173listView.Columns.Add(new ColumnHeader("Column 2") { Width = 70 }); 1191listView.Columns.Add(new ColumnHeader("Column 1") { Width = 70 }); 1192listView.Columns.Add(new ColumnHeader("Column 2") { Width = 70 }); 1193listView.Columns.Add(new ColumnHeader("Column 3") { Width = 70 }); 1217listView.Columns.Add(new ColumnHeader("Column 1") { Width = 70 }); 1218listView.Columns.Add(new ColumnHeader("Column 2") { Width = 70 }); 1219listView.Columns.Add(new ColumnHeader("Column 3") { Width = 70 }); 1402listView.Columns.Add(new ColumnHeader() { Name = "Column 1" }); 1403listView.Columns.Add(new ColumnHeader() { Name = "Column 2" }); 1404listView.Columns.Add(new ColumnHeader() { Name = "Column 3" });
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (3)
587listView.Columns.Add(new ColumnHeader()); 1217listView.Columns.Add(new ColumnHeader()); 1429listView.Columns.Add(new ColumnHeader());
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemAccessibleObjectTests.cs (22)
1156listView.Columns.Add(new ColumnHeader($"Column {i}")); 1213listView.Columns.Add(new ColumnHeader() { Name = "Column 1" }); 1214listView.Columns.Add(new ColumnHeader() { Name = "Column 2" }); 1215listView.Columns.Add(new ColumnHeader() { Name = "Column 3" }); 1294listView.Columns.Add(new ColumnHeader()); 1353listView.Columns.Add(new ColumnHeader()); 1411listView.Columns.Add(new ColumnHeader()); 1458listView.Columns.Add(new ColumnHeader()); 1538listView.Columns.Add(new ColumnHeader()); 1539listView.Columns.Add(new ColumnHeader()); 1582listView.Columns.Add(new ColumnHeader()); 1583listView.Columns.Add(new ColumnHeader()); 1584listView.Columns.Add(new ColumnHeader()); 1596listView.Columns.Add(new ColumnHeader()); 1597listView.Columns.Add(new ColumnHeader()); 1598listView.Columns.Add(new ColumnHeader()); 1599listView.Columns.Add(new ColumnHeader()); 1623listView.Columns.Add(new ColumnHeader()); 1641listView.Columns.Add(new ColumnHeader()); 1642listView.Columns.Add(new ColumnHeader()); 1643listView.Columns.Add(new ColumnHeader()); 1977listView.Columns.Add(new ColumnHeader());
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemDetailsAccessibleObjectTests.cs (15)
23control.Columns.Add(new ColumnHeader()); 39control.Columns.AddRange((ColumnHeader[])[new(), new(), new()]); 43AccessibleObject expected = item.SubItems[control.Columns.Count - 1].AccessibilityObject; 54control.Columns.AddRange((ColumnHeader[])[new(), new(), new()]); 55int outRangeIndex = control.Columns.Count + 1; 71control.Columns.AddRange((ColumnHeader[])[new(), new(), new()]); 102control.Columns.AddRange((ColumnHeader[])[new(), new(), new()]); 107Assert.Equal(control.Columns.Count, accessibleObject.GetChildCount()); 117control.Columns.AddRange((ColumnHeader[])[new(), new(), new()]); 141listView.Columns.Add(new ColumnHeader()); 169listView1.Columns.AddRange((ColumnHeader[])[columnHeader1, columnHeader2, columnHeader3]); 200listView1.Columns.RemoveAt(0); 204foreach (ColumnHeader col in listView1.Columns) 224listView1.Columns.RemoveAt(0); 228foreach (ColumnHeader col in listView1.Columns)
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemImageAccessibleObjectTests.cs (2)
24list.Columns.Add(column); 50list.Columns.Add(column);
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs (10)
28list.Columns.AddRange( 65list.Columns.AddRange( 640list.Columns.AddRange( 687list.Columns.AddRange( 728list.Columns.AddRange( 764list.Columns.AddRange( 820listView.Columns.Add(new ColumnHeader($"Column {i}")); 877listView.Columns.AddRange([new() { Width = 120, Text = "Column 1" }, new() { Width = 120, Text = "Column 2" }]); 899listView.Columns.AddRange([new() { Width = 120, Text = "Column 1" }, new() { Width = 120, Text = "Column 2" }]); 1014ListView.ColumnHeaderCollection columns = control.Columns;
System\Windows\Forms\AccessibleObjects\ListViewLabelEditAccessibleObjectTests.cs (1)
161listView.Columns.Add(new ColumnHeader() { Text = "Column 1", Width = 100 });
System\Windows\Forms\ColumnHeaderTests.cs (70)
90listView.Columns.Add(header); 134listView.Columns.Add(header1); 135listView.Columns.Add(header2); 136listView.Columns.Add(header3); 138listView.Columns[columnIndex].DisplayIndex = value; 145listView.Columns[columnIndex].DisplayIndex = value; 160listView.Columns.Add(header1); 161listView.Columns.Add(header2); 162listView.Columns.Add(header3); 171listView.Columns[columnIndex].DisplayIndex = value; 181listView.Columns[columnIndex].DisplayIndex = value; 214listView.Columns.Add(header1); 215listView.Columns.Add(header2); 216listView.Columns.Add(header3); 219listView.Columns[columnIndex].DisplayIndex = value; 232listView.Columns.Add(header); 325listView.Columns.Add(header); 351listView.Columns.Add(header); 382listView.Columns.Add(header); 404listView.Columns.Add(header); 439listView.Columns.Add(header); 468listView.Columns.Add(header); 494listView.Columns.Add(header); 544listView.Columns.Add(header); 568listView.Columns.Add(header); 601listView.Columns.Add(header); 621listView.Columns.Add(header); 659listView.Columns.Add(header); 690listView.Columns.Add(header); 708listView.Columns.Add(header); 720listView.Columns.Add(header); 733listView.Columns.Add(header); 742listView.Columns.Add(header); 751listView.Columns.Add(header); 794listView.Columns.Add(header); 812listView.Columns.Add(header); 971listView.Columns.Add(header); 987listView.Columns.Add(header); 1004listView.Columns.Add(header); 1035listView.Columns.Add(header1); 1036listView.Columns.Add(header2); 1132listView.Columns.Add(header1); 1133listView.Columns.Add(header2); 1135listView.Columns[columnIndex].TextAlign = value; 1136Assert.Equal(expected, listView.Columns[columnIndex].TextAlign); 1140listView.Columns[columnIndex].TextAlign = value; 1141Assert.Equal(expected, listView.Columns[columnIndex].TextAlign); 1157listView.Columns.Add(header1); 1158listView.Columns.Add(header2); 1167listView.Columns[columnIndex].TextAlign = value; 1168Assert.Equal(expected, listView.Columns[columnIndex].TextAlign); 1175listView.Columns[columnIndex].TextAlign = value; 1176Assert.Equal(expected, listView.Columns[columnIndex].TextAlign); 1195listView.Columns.Add(header1); 1196listView.Columns.Add(header2); 1199listView.Columns[columnIndex].TextAlign = value; 1221listView.Columns.Add(header); 1231listView.Columns.Add(header); 1255listView.Columns.Add(header); 1303listView.Columns.Add(header); 1321listView.Columns.Add(header); 1358listView.Columns.Add(header); 1376listView.Columns.Add(header); 1402listView.Columns.Add(header); 1420listView.Columns.Add(header); 1509listView.Columns.Add(source); 1581listView.Columns.Add(header); 1583Assert.Empty(listView.Columns); 1586Assert.Empty(listView.Columns); 1636listView.Columns.Add(header);
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (14)
146listView.Columns.Add(new ColumnHeader() { Width = 50 }); 166listView.Columns.Add(new ColumnHeader() { Width = columnWidth }); 411listView.Columns.Add(new ColumnHeader()); 430listView.Columns.Add(new ColumnHeader()); 451listView.Columns.Add(new ColumnHeader()); 471listView.Columns.Add(new ColumnHeader()); 492listView.Columns.Add(new ColumnHeader()); 514listView.Columns.Add(new ColumnHeader()); 535listView.Columns.Add(new ColumnHeader()); 555listView.Columns.Add(new ColumnHeader()); 575listView.Columns.Add(new ColumnHeader()); 592listView.Columns.Add(new ColumnHeader()); 609listView.Columns.Add(new ColumnHeader()); 627listView.Columns.Add(new ColumnHeader());
System\Windows\Forms\ListViewTests.cs (13)
54Assert.Empty(control.Columns); 55Assert.Same(control.Columns, control.Columns); 5016listView.Columns.AddRange( 5072listView.Columns.AddRange( 5147listView.Columns.Add(new ColumnHeader() { Text = "Column 1", Width = 100 }); 5148listView.Columns.Add(new ColumnHeader() { Text = "Column 2", Width = 100 }); 5149listView.Columns.Add(new ColumnHeader() { Text = "Column 3", Width = 100 }); 5224listView.Columns.Add(new ColumnHeader() { Text = "Column 1", Width = 100 }); 5225listView.Columns.Add(new ColumnHeader() { Text = "Column 2", Width = 100 }); 5226listView.Columns.Add(new ColumnHeader() { Text = "Column 3", Width = 100 }); 5429listView.Columns.AddRange( 6194listView.Columns.Add(new ColumnHeader() { Name = "Column 1" });
System.Windows.Forms.UI.IntegrationTests (2)
ListViewTests.cs (2)
520listView.Columns.AddRange([columnHeader1, columnHeader2, columnHeader3]); 553listView.Columns.Add(new ColumnHeader() { Text = $"ColumnHeader{i}" });
WinFormsControlsTest (11)
ListViewTest.cs (6)
119listView2.Columns.Add("column1", "Item Column", -2, HorizontalAlignment.Left, 0); 120listView2.Columns.Add("Column 2", -2, HorizontalAlignment.Left); 121listView2.Columns.Add("Column 3", -2, HorizontalAlignment.Left); 122listView2.Columns.Add("Column 4", -2, HorizontalAlignment.Center); 228listView2.Columns[random.Next(0, listView2.Columns.Count)].ImageIndex = random.Next(0, 2);
ListViewTest.Designer.cs (1)
67this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
MultipleControls.cs (4)
81listView2.Columns.Add("column1", "Item Column", -2, HorizontalAlignment.Left, 0); 82listView2.Columns.Add("Column 2", -2, HorizontalAlignment.Left); 83listView2.Columns.Add("Column 3", -2, HorizontalAlignment.Left); 84listView2.Columns.Add("Column 4", -2, HorizontalAlignment.Center);