442 references to SubItems
Accessibility_Core_App (1)
DataBindingExample.cs (1)
108item.SubItems.Add(dataSet.Tables[0].Rows[i][j].ToString());
System.Windows.Forms (57)
System\Windows\Forms\Controls\ListView\DrawListViewItemEventArgs.cs (2)
101if (!Item.ListView.FullRowSelect && Item.SubItems.Count > 0) 103ListViewItem.ListViewSubItem subItem = Item.SubItems[0];
System\Windows\Forms\Controls\ListView\ListView.cs (19)
2711if (nmcd->iSubItem < Items[itemIndex].SubItems.Count) 2717if (nmcd->iSubItem == 0 && Items[itemIndex].SubItems.Count > 1) 2732Items[itemIndex].SubItems[nmcd->iSubItem], 2788if (item is not null && subitem < item.SubItems.Count) 2794subItemFont = new Font(item.SubItems[0].Font, FontStyle.Underline); 2798subItemFont = item.SubItems[subitem].Font; 2808subItemForeColor = item.SubItems[subitem].ForeColor; 2809subItemBackColor = item.SubItems[subitem].BackColor; 3325for (int j = 0; j < listViewItem.SubItems.Count; j++) 3327ListViewSubItem listViewSubItem = listViewItem.SubItems[j]; 3645ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(subItemIndex, Items[itemIndex].SubItems.Count); 3737if (lvhi.iSubItem < item.SubItems.Count) 3739_listViewSubItem = item.SubItems[lvhi.iSubItem]; 4210for (int nItem = 1; nItem < li.SubItems.Count; ++nItem) 4212SetItemText(insertIndex, nItem, li.SubItems[nItem].Text, ref lvItem); 4924int subItemCount = Items[i].SubItems.Count; 4927SetItemText(i, j, Items[i].SubItems[j].Text, ref item); 6764if (lvItem.SubItems.Count <= dispInfo->item.iSubItem) 6770text = lvItem.SubItems[dispInfo->item.iSubItem].Text; // we want the sub item
System\Windows\Forms\Controls\ListView\ListView.ListViewItemCollection.cs (2)
292for (int j = 1; j < listViewItems[i].SubItems.Count; j++) 294if (WindowsFormsUtils.SafeCompareStrings(listViewItems[i].SubItems[j].Name, key, ignoreCase: true))
System\Windows\Forms\Controls\ListView\ListViewItem.cs (10)
298set => SubItems[0].BackColor = value; 406set => SubItems[0].Font = value; 431SubItems[0].ForeColor = value; 620set => SubItems[0].Name = value; 819set => SubItems[0].Text = value; 886ListViewSubItem[] clonedSubItems = new ListViewSubItem[SubItems.Count]; 887for (int index = 0; index < SubItems.Count; ++index) 889ListViewSubItem subItem = SubItems[index]; 981if (iItem == Index && iSubItem != -1 && iSubItem < SubItems.Count) 983return SubItems[iSubItem];
System\Windows\Forms\Controls\ListView\ListViewItem.IKeyboardToolTip.cs (2)
125if (SubItems.Count > 1) 127ListViewSubItem subItem = SubItems[1];
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemBaseAccessibleObject.cs (1)
250foreach (ListViewSubItem subItem in _owningItem.SubItems)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemDetailsAccessibleObject.cs (3)
105int subItemIndex = _owningItem.SubItems.IndexOf(subItemAccessibleObject.OwningSubItem); 143if (subItemIndex < _owningItem.SubItems.Count) 147return _owningItem.SubItems[subItemIndex].AccessibilityObject;
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemTileAccessibleObject.cs (7)
55|| _owningItem.SubItems.Count <= index 61return _owningItem.SubItems[index].AccessibilityObject; 76if (_owningItem.SubItems.Count == 1) 88|| child == _owningItem.SubItems[0].AccessibilityObject 95int index = _owningItem.SubItems.IndexOf(subItemAccessibleObject.OwningSubItem); 103if (_owningItem.SubItems.Count == 1) 109int subItemCount = Math.Min(_owningListView.Columns.Count, _owningItem.SubItems.Count);
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.cs (3)
101return _owner._listView.GetSubItemRect(_owner.Index, _owner.SubItems.IndexOf(this)); 187internal int Index => _owner is null ? -1 : _owner.SubItems.IndexOf(this); 209_owner?.UpdateSubItems(_owner.SubItems.IndexOf(this));
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItemCollection.cs (1)
201_owner.SubItems[i]._owner = null;
System\Windows\Forms\Controls\ListView\ListViewItemConverter.cs (6)
49for (int i = 1; i < item.SubItems.Count; ++i) 51if (item.SubItems[i].CustomStyle) 57ListViewItem.ListViewSubItem[] subItemArray = new ListViewItem.ListViewSubItem[item.SubItems.Count]; 58((ICollection)item.SubItems).CopyTo(subItemArray, 0); 65ListViewItem.ListViewSubItem[] subItemArray = new ListViewItem.ListViewSubItem[item.SubItems.Count]; 66((ICollection)item.SubItems).CopyTo(subItemArray, 0);
System\Windows\Forms\Controls\ListView\ListViewLabelEditAccessibleObject.cs (1)
58=> _owningListView.TryGetTarget(out ListView? target) && target.View == View.Tile ? target._selectedItem?.SubItems[1].AccessibilityObject : null,
System.Windows.Forms.Tests (317)
SerializableTypesTests.cs (1)
186var item = Assert.Single(result.SubItems) as ListViewSubItem;
System\Windows\Forms\AccessibleObjects\ListVIew.ListViewAccessibleObjectTests.cs (6)
1199Assert.Equal(listView.Items[0].SubItems[0].AccessibilityObject, HitTest(listView, GetSubItemLocation(0, 0))); 1200Assert.Equal(listView.Items[0].SubItems[1].AccessibilityObject, HitTest(listView, GetSubItemLocation(0, 1))); 1201Assert.Equal(listView.Items[0].SubItems[2].AccessibilityObject, HitTest(listView, GetSubItemLocation(0, 2))); 1202Assert.Equal(listView.Items[1].SubItems[0].AccessibilityObject, HitTest(listView, GetSubItemLocation(1, 0))); 1203Assert.Equal(listView.Items[1].SubItems[1].AccessibilityObject, HitTest(listView, GetSubItemLocation(1, 1))); 1204Assert.Equal(listView.Items[1].SubItems[2].AccessibilityObject, HitTest(listView, GetSubItemLocation(1, 2)));
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemAccessibleObjectTests.cs (49)
354Assert.Equal(listView.Items[0].SubItems[0].AccessibilityObject, accessibleObject1.FragmentNavigate(NavigateDirection.NavigateDirection_FirstChild)); 355Assert.Equal(listView.Items[1].SubItems[0].AccessibilityObject, accessibleObject2.FragmentNavigate(NavigateDirection.NavigateDirection_FirstChild)); 356Assert.Equal(listView.Items[2].SubItems[0].AccessibilityObject, accessibleObject3.FragmentNavigate(NavigateDirection.NavigateDirection_FirstChild)); 357Assert.Equal(listView.Items[3].SubItems[0].AccessibilityObject, accessibleObject4.FragmentNavigate(NavigateDirection.NavigateDirection_FirstChild)); 384Assert.Equal(listView.Items[0].SubItems[0].AccessibilityObject, accessibleObject1.FragmentNavigate(NavigateDirection.NavigateDirection_FirstChild)); 385Assert.Equal(listView.Items[1].SubItems[0].AccessibilityObject, accessibleObject2.FragmentNavigate(NavigateDirection.NavigateDirection_FirstChild)); 437Assert.Equal(listView.Items[0].SubItems[2].AccessibilityObject, accessibleObject1.FragmentNavigate(NavigateDirection.NavigateDirection_LastChild)); 438Assert.Equal(listView.Items[1].SubItems[2].AccessibilityObject, accessibleObject2.FragmentNavigate(NavigateDirection.NavigateDirection_LastChild)); 455Assert.NotEqual(listView.Items[0].SubItems[0].AccessibilityObject, lastChild1); 456Assert.NotEqual(listView.Items[1].SubItems[0].AccessibilityObject, lastChild2); 471Assert.Equal(listView.Items[0].SubItems[0].AccessibilityObject, lastChild1); 472Assert.Equal(listView.Items[1].SubItems[0].AccessibilityObject, lastChild2); 489Assert.Single(listView.Items[0].SubItems); 490Assert.Single(listView.Items[1].SubItems); 492listView.Items[0].SubItems.Add(new ListViewSubItem() { Text = $"SubItem 0" }); 493listView.Items[1].SubItems.Add(new ListViewSubItem() { Text = $"SubItem 0" }); 498Assert.Equal(listView.Items[0].SubItems[1].AccessibilityObject, lastChild1); 499Assert.Equal(listView.Items[1].SubItems[1].AccessibilityObject, lastChild2); 500Assert.Equal(2, listView.Items[0].SubItems.Count); 501Assert.Equal(2, listView.Items[1].SubItems.Count); 516Assert.Equal(listView.Items[0].SubItems[1].AccessibilityObject, lastChild1); 517Assert.Equal(listView.Items[1].SubItems[1].AccessibilityObject, lastChild2); 518Assert.Equal(2, listView.Items[0].SubItems.Count); 519Assert.Equal(2, listView.Items[1].SubItems.Count); 521listView.Items[0].SubItems.RemoveAt(1); 522listView.Items[1].SubItems.RemoveAt(1); 529Assert.Single(listView.Items[0].SubItems); 530Assert.Single(listView.Items[1].SubItems); 1058Assert.Equal(listView.Items[0].SubItems[0].AccessibilityObject, accessibleObject1.GetChild(0)); 1059Assert.Equal(listView.Items[0].SubItems[1].AccessibilityObject, accessibleObject1.GetChild(1)); 1064Assert.Equal(listView.Items[1].SubItems[0].AccessibilityObject, accessibleObject2.GetChild(0)); 1065Assert.Equal(listView.Items[1].SubItems[1].AccessibilityObject, accessibleObject2.GetChild(1)); 1098Assert.Equal(listView.Items[0].SubItems[0].AccessibilityObject, accessibleObject1.GetChild(0)); 1099Assert.Equal(listView.Items[0].SubItems[1].AccessibilityObject, accessibleObject1.GetChild(1)); 1100Assert.Equal(listView.Items[0].SubItems[2].AccessibilityObject, accessibleObject1.GetChild(2)); 1102Assert.Equal(listView.Items[1].SubItems[0].AccessibilityObject, accessibleObject2.GetChild(0)); 1103Assert.Equal(listView.Items[1].SubItems[1].AccessibilityObject, accessibleObject2.GetChild(1)); 1104Assert.Equal(listView.Items[1].SubItems[2].AccessibilityObject, accessibleObject2.GetChild(2)); 1150listItem1.SubItems.Add(new ListViewSubItem() { Text = $"SubItem {i}" }); 1151listItem2.SubItems.Add(new ListViewSubItem() { Text = $"SubItem {i}" }); 1544Assert.Equal(0, accessibleObject.GetChildIndex(listView.Items[0].SubItems[0].AccessibilityObject)); 1545Assert.Equal(1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[1].AccessibilityObject)); 1546Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[2].AccessibilityObject)); 1550Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[0].AccessibilityObject)); 1551Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[1].AccessibilityObject)); 1552Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[2].AccessibilityObject)); 1588Assert.Equal(-1, listView.Items[0].AccessibilityObject.GetChildIndex(listView.Items[1].SubItems[1].AccessibilityObject)); 1603Assert.Equal(0, accessibleObject.GetChildIndex(listView.Items[0].SubItems[0].AccessibilityObject)); 1628Assert.Equal(expectedFirstSubItemIndex, accessibleObject.GetChildIndex(listView.Items[0].SubItems[0].AccessibilityObject));
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemDetailsAccessibleObjectTests.cs (7)
27AccessibleObject expected = item.SubItems[0].AccessibilityObject; 40item.SubItems.AddRange(new ListViewSubItem[] { new(), new(), new(), new(), new() }); 43AccessibleObject expected = item.SubItems[control.Columns.Count - 1].AccessibilityObject; 72item.SubItems.AddRange(new ListViewSubItem[] { new(), new(), new(), new() }); 76Assert.Equal(item.SubItems[0].AccessibilityObject, accessibleObject.GetChild(0)); 77Assert.Equal(item.SubItems[1].AccessibilityObject, accessibleObject.GetChild(1)); 78Assert.Equal(item.SubItems[2].AccessibilityObject, accessibleObject.GetChild(2));
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs (108)
106AccessibleObject accessibleObject = list.Items[0].SubItems[1].AccessibilityObject; 143AccessibleObject subItemAccObj1 = listViewItem.SubItems[0].AccessibilityObject; 144AccessibleObject subItemAccObj2 = listViewItem.SubItems[1].AccessibilityObject; 145AccessibleObject subItemAccObj3 = listViewItem.SubItems[2].AccessibilityObject; 147AccessibleObject subItemAccObjInGroup1 = listViewItemInGroup.SubItems[0].AccessibilityObject; 148AccessibleObject subItemAccObjInGroup2 = listViewItemInGroup.SubItems[1].AccessibilityObject; 149AccessibleObject subItemAccObjInGroup3 = listViewItemInGroup.SubItems[2].AccessibilityObject; 190AccessibleObject subItemAccObj1 = listViewItem.SubItems[0].AccessibilityObject; 191AccessibleObject subItemAccObj2 = listViewItem.SubItems[1].AccessibilityObject; 192AccessibleObject subItemAccObj3 = listViewItem.SubItems[2].AccessibilityObject; 194AccessibleObject subItemAccObjInGroup1 = listViewItemInGroup.SubItems[0].AccessibilityObject; 195AccessibleObject subItemAccObjInGroup2 = listViewItemInGroup.SubItems[1].AccessibilityObject; 196AccessibleObject subItemAccObjInGroup3 = listViewItemInGroup.SubItems[2].AccessibilityObject; 220AccessibleObject subItemAccObj1 = listViewItem.SubItems[0].AccessibilityObject; 221AccessibleObject subItemAccObj2 = listViewItem.SubItems[1].AccessibilityObject; 222AccessibleObject subItemAccObj3 = listViewItem.SubItems[2].AccessibilityObject; 224AccessibleObject subItemAccObjInGroup1 = listViewItemInGroup.SubItems[0].AccessibilityObject; 225AccessibleObject subItemAccObjInGroup2 = listViewItemInGroup.SubItems[1].AccessibilityObject; 226AccessibleObject subItemAccObjInGroup3 = listViewItemInGroup.SubItems[2].AccessibilityObject; 250AccessibleObject subItemAccObj1 = listViewItem.SubItems[0].AccessibilityObject; 251AccessibleObject subItemAccObj2 = listViewItem.SubItems[1].AccessibilityObject; 252AccessibleObject subItemAccObj3 = listViewItem.SubItems[2].AccessibilityObject; 254AccessibleObject subItemAccObjInGroup1 = listViewItemInGroup.SubItems[0].AccessibilityObject; 255AccessibleObject subItemAccObjInGroup2 = listViewItemInGroup.SubItems[1].AccessibilityObject; 256AccessibleObject subItemAccObjInGroup3 = listViewItemInGroup.SubItems[2].AccessibilityObject; 291AccessibleObject subItemAccObj1 = listViewItem.SubItems[0].AccessibilityObject; 292AccessibleObject subItemAccObj2 = listViewItem.SubItems[1].AccessibilityObject; 293AccessibleObject subItemAccObj3 = listViewItem.SubItems[2].AccessibilityObject; 295AccessibleObject subItemAccObjInGroup1 = listViewItemInGroup.SubItems[0].AccessibilityObject; 296AccessibleObject subItemAccObjInGroup2 = listViewItemInGroup.SubItems[1].AccessibilityObject; 297AccessibleObject subItemAccObjInGroup3 = listViewItemInGroup.SubItems[2].AccessibilityObject; 327AccessibleObject subItemAccObj1 = listViewItem.SubItems[0].AccessibilityObject; 328AccessibleObject subItemAccObj2 = listViewItem.SubItems[1].AccessibilityObject; 329AccessibleObject subItemAccObj3 = listViewItem.SubItems[2].AccessibilityObject; 331AccessibleObject subItemAccObjInGroup1 = listViewItemInGroup.SubItems[0].AccessibilityObject; 332AccessibleObject subItemAccObjInGroup2 = listViewItemInGroup.SubItems[1].AccessibilityObject; 333AccessibleObject subItemAccObjInGroup3 = listViewItemInGroup.SubItems[2].AccessibilityObject; 360AccessibleObject subItemAccObj = listViewItem.SubItems[0].AccessibilityObject; 361AccessibleObject subItemAccInGroup = listViewItemInGroup.SubItems[0].AccessibilityObject; 369Assert.Same(listViewItem.SubItems[1].AccessibilityObject, nextSubItemAccObj1); 372Assert.Same(listViewItemInGroup.SubItems[1].AccessibilityObject, nextSubItemAccInGroup1); 386AccessibleObject subItemAccObj = listViewItem.SubItems[0].AccessibilityObject; 387AccessibleObject subItemAccInGroup = listViewItemInGroup.SubItems[0].AccessibilityObject; 412AccessibleObject subItemAccObj = listViewItem.SubItems[0].AccessibilityObject; 413AccessibleObject subItemAccInGroup = listViewItemInGroup.SubItems[0].AccessibilityObject; 431AccessibleObject subItemAccObj = listViewItem.SubItems[3].AccessibilityObject; 432AccessibleObject subItemAccInGroup = listViewItemInGroup.SubItems[3].AccessibilityObject; 444Assert.Same(listViewItem.SubItems[2].AccessibilityObject, previousSubItemAccObj3); 445Assert.Same(listViewItem.SubItems[1].AccessibilityObject, previousSubItemAccObj2); 446Assert.Same(listViewItem.SubItems[0].AccessibilityObject, previousSubItemAccObj1); 449Assert.Same(listViewItemInGroup.SubItems[2].AccessibilityObject, previousSubItemAccInGroup3); 450Assert.Same(listViewItemInGroup.SubItems[1].AccessibilityObject, previousSubItemAccInGroup2); 451Assert.Same(listViewItemInGroup.SubItems[0].AccessibilityObject, previousSubItemAccInGroup1); 465AccessibleObject subItemAccObj = listViewItem.SubItems[0].AccessibilityObject; 466AccessibleObject subItemAccInGroup = listViewItemInGroup.SubItems[0].AccessibilityObject; 471listViewItem.SubItems.Add("SubItem"); 472listViewItemInGroup.SubItems.Add("SubItem"); 474Assert.Same(listViewItem.SubItems[1].AccessibilityObject, subItemAccObj.FragmentNavigate(NavigateDirection.NavigateDirection_NextSibling)); 475Assert.Same(listViewItemInGroup.SubItems[1].AccessibilityObject, subItemAccInGroup.FragmentNavigate(NavigateDirection.NavigateDirection_NextSibling)); 494listViewItem.SubItems.Add("SubItem"); 495listViewItemInGroup.SubItems.Add("SubItem"); 497Assert.Same(listViewItem.SubItems[1].AccessibilityObject, subItemAccObj.FragmentNavigate(NavigateDirection.NavigateDirection_PreviousSibling)); 498Assert.Same(listViewItemInGroup.SubItems[1].AccessibilityObject, subItemAccInGroup.FragmentNavigate(NavigateDirection.NavigateDirection_PreviousSibling)); 511AccessibleObject subItemAccObj = listViewItem.SubItems[0].AccessibilityObject; 512AccessibleObject subItemAccInGroup = listViewItemInGroup.SubItems[0].AccessibilityObject; 514Assert.Same(listViewItem.SubItems[1].AccessibilityObject, subItemAccObj.FragmentNavigate(NavigateDirection.NavigateDirection_NextSibling)); 515Assert.Same(listViewItemInGroup.SubItems[1].AccessibilityObject, subItemAccInGroup.FragmentNavigate(NavigateDirection.NavigateDirection_NextSibling)); 517listViewItem.SubItems.RemoveAt(1); 518listViewItemInGroup.SubItems.RemoveAt(1); 537Assert.Same(listViewItem.SubItems[1].AccessibilityObject, subItemAccObj.FragmentNavigate(NavigateDirection.NavigateDirection_PreviousSibling)); 538Assert.Same(listViewItemInGroup.SubItems[1].AccessibilityObject, subItemAccInGroup.FragmentNavigate(NavigateDirection.NavigateDirection_PreviousSibling)); 540listViewItem.SubItems.Add("SubItem"); 541listViewItemInGroup.SubItems.Add("SubItem"); 575Assert.Same(listView.Items[0].SubItems[0].AccessibilityObject, previousSubItemAccObj1); 581Assert.Same(listViewItemInGroup.SubItems[0].AccessibilityObject, previousSubItemAccInGroup1); 595AccessibleObject subItemAccObj = listView.Items[0].SubItems[0].AccessibilityObject; 596AccessibleObject subItemAccInGroup = listViewItemInGroup.SubItems[0].AccessibilityObject; 652ListViewItem.ListViewSubItem subItem = listViewItem1.SubItems[0]; 656int expectedWidth = listViewItem1.SubItems[1].Bounds.X - subItem.Bounds.X; 701Assert.Equal(0, listViewItem1.SubItems[0].AccessibilityObject.Column); 702Assert.Equal(1, listViewItem1.SubItems[1].AccessibilityObject.Column); 703Assert.Equal(2, listViewItem1.SubItems[2].AccessibilityObject.Column); 704Assert.Equal(-1, listViewItem1.SubItems[3].AccessibilityObject.Column); 742Assert.Equal(-1, listViewItem1.SubItems[0].AccessibilityObject.Column); 743Assert.Equal(-1, listViewItem1.SubItems[1].AccessibilityObject.Column); 744Assert.Equal(-1, listViewItem1.SubItems[2].AccessibilityObject.Column); 745Assert.Equal(-1, listViewItem1.SubItems[3].AccessibilityObject.Column); 814listItem1.SubItems.Add($"SubItem {i}"); 815listItem2.SubItems.Add($"SubItem {i}"); 879listView.Items[0].SubItems.Add("Test item 12"); 882var subItemAccessibleObject = listView.Items[0].SubItems[0].AccessibilityObject; 901listView.Items[0].SubItems.Add("Test item 12"); 904var subItemAccessibleObject = listView.Items[0].SubItems[0].AccessibilityObject; 1017var subItemAccessibleObject = (ListViewSubItemAccessibleObject)control.Items[0].SubItems[i].AccessibilityObject; 1041var subItemAccessibleObject = (ListViewSubItemAccessibleObject)control.Items[0].SubItems[1].AccessibilityObject; 1052listViewItem.SubItems.Add(listViewSubItem); 1064listViewItem.SubItems.Add(listViewSubItem); 1080listViewItem.SubItems.Add(listViewSubItem); 1096listViewItem.SubItems.Add(listViewSubItem); 1112listViewItem.SubItems.Add(listViewSubItem); 1116listView.Items[0].SubItems.Remove(listViewSubItem); 1128listViewItem.SubItems.Add(listViewSubItem); 1132listView.Items[0].SubItems.Clear(); 1144listViewItem.SubItems.Add(listViewSubItem); 1160listViewItem.SubItems.Add(listViewSubItem); 1164int subItemIndex = listView.Items[0].SubItems.IndexOf(listViewSubItem); 1165listView.Items[0].SubItems[subItemIndex] = new ListViewItem.ListViewSubItem(); 1175foreach (ListViewItem.ListViewSubItem subItem in item.SubItems)
System\Windows\Forms\AccessibleObjects\ListViewLabelEditAccessibleObjectTests.cs (1)
165item.SubItems.Add(subItem);
System\Windows\Forms\DrawListViewItemEventArgsTests.cs (2)
92subItemsItem.SubItems.Add(new ListViewItem.ListViewSubItem()); 100fullRowSelectListViewItem.SubItems.Add(new ListViewItem.ListViewSubItem());
System\Windows\Forms\ListView.ListViewItemCollectionTests.cs (3)
42child3.SubItems.Add(grandchild1); 43child3.SubItems.Add(grandchild2); 44child3.SubItems.Add(grandchild3);
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (3)
179listViewItem.SubItems.Add(new ListViewSubItem(listViewItem, new string('t', 10))); 195listViewItem.SubItems.Add(listViewSubItem); 784listViewItem.SubItems.Add(i.ToString());
System\Windows\Forms\ListViewItemTests.cs (66)
33ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 35Assert.Same(item.SubItems, item.SubItems); 72AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 73Assert.Same(item.SubItems, item.SubItems); 110AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 111Assert.Same(item.SubItems, item.SubItems); 148AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 149Assert.Same(item.SubItems, item.SubItems); 186AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 187Assert.Same(item.SubItems, item.SubItems); 223AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 224Assert.Same(item.SubItems, item.SubItems); 260AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 261Assert.Same(item.SubItems, item.SubItems); 298AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 299Assert.Same(item.SubItems, item.SubItems); 336AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 337Assert.Same(item.SubItems, item.SubItems); 373ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 375Assert.Same(item.SubItems, item.SubItems); 411ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 413Assert.Same(item.SubItems, item.SubItems); 449AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 450Assert.Same(item.SubItems, item.SubItems); 486AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 487Assert.Same(item.SubItems, item.SubItems); 524AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 525Assert.Same(item.SubItems, item.SubItems); 562AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 563Assert.Same(item.SubItems, item.SubItems); 600AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 601Assert.Same(item.SubItems, item.SubItems); 637ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 639Assert.Same(item.SubItems, item.SubItems); 675ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 677Assert.Same(item.SubItems, item.SubItems); 713ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 715Assert.Same(item.SubItems, item.SubItems); 750ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 752Assert.Same(item.SubItems, item.SubItems); 789AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 790Assert.Same(item.SubItems, item.SubItems); 819ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 821Assert.Same(item.SubItems, item.SubItems);
System\Windows\Forms\ListViewSubItemCollectionTests.cs (53)
883listViewItem.SubItems.Add(subItem); 893listViewItem.SubItems.Add("Test"); 895Assert.Same(listViewItem, listViewItem.SubItems[1]._owner); 903listViewItem.SubItems.Add("Test", Color.White, Color.Black, SystemFonts.MenuFont); 905Assert.Same(listViewItem, listViewItem.SubItems[1]._owner); 918listViewItem.SubItems.AddRange([subItem1, subItem2]); 929listViewItem.SubItems.AddRange(["Test 1", "Test 2"]); 931Assert.Same(listViewItem, listViewItem.SubItems[1]._owner); 932Assert.Same(listViewItem, listViewItem.SubItems[2]._owner); 940listViewItem.SubItems.AddRange(["Test 1", "Test 2"], Color.White, Color.Black, SystemFonts.MenuFont); 942Assert.Same(listViewItem, listViewItem.SubItems[1]._owner); 943Assert.Same(listViewItem, listViewItem.SubItems[2]._owner); 952ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 954listViewItem.SubItems.Add(subItem1); 955listViewItem.SubItems.Add(subItem2); 961listViewItem.SubItems.Clear(); 963Assert.Same(listViewItem, listViewItem.SubItems[0]._owner); 977((IList)listViewItem.SubItems).Add(subItem); 988ListViewItem.ListViewSubItem oldSubItem1 = listViewItem.SubItems[0]; 990listViewItem.SubItems.Add(oldSubItem2); 997((IList)listViewItem.SubItems).Insert(0, subItem1); 998((IList)listViewItem.SubItems).Insert(1, subItem2); 1000Assert.Equal(4, listViewItem.SubItems.Count); 1002Assert.Same(subItem1, listViewItem.SubItems[0]); 1003Assert.Same(subItem2, listViewItem.SubItems[1]); 1004Assert.Same(oldSubItem1, listViewItem.SubItems[2]); 1005Assert.Same(oldSubItem2, listViewItem.SubItems[3]); 1017ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 1019listViewItem.SubItems.Add(subItem); 1024listViewItem.SubItems.Remove(subItem); 1025listViewItem.SubItems.Remove(oldSubItem); 1027Assert.Same(listViewItem, listViewItem.SubItems[0]._owner); 1037ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 1042((IList)listViewItem.SubItems)[0] = subItem; 1054ListViewItem.ListViewSubItem defaultSubItem = listViewItem.SubItems[0]; 1060listViewItem.SubItems.Insert(0, subItem1); 1061listViewItem.SubItems.Insert(1, subItem2); 1063Assert.Equal(3, listViewItem.SubItems.Count); 1074ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 1076listViewItem.SubItems.Add(subItem); 1081listViewItem.SubItems.Remove(subItem); 1082listViewItem.SubItems.Remove(oldSubItem); 1086Assert.Same(listViewItem, listViewItem.SubItems[0]._owner); 1093ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 1095listViewItem.SubItems.Add(subItem); 1100listViewItem.SubItems.RemoveAt(1); 1101listViewItem.SubItems.RemoveAt(0); 1105Assert.Same(listViewItem, listViewItem.SubItems[0]._owner); 1112ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 1115listViewItem.SubItems.Add(subItem); 1120listViewItem.SubItems.RemoveByKey("Test 2"); 1121listViewItem.SubItems.RemoveByKey("Test 1"); 1125Assert.Same(listViewItem, listViewItem.SubItems[0]._owner);
System\Windows\Forms\ListViewSubItemTests.cs (15)
107item.SubItems.Remove(subItem); 124item.SubItems.Add(subItem); 128item.SubItems.Remove(subItem); 173item.SubItems.Add(subItem); 192item.SubItems.Add(subItem); 243item.SubItems.Remove(subItem); 261item.SubItems.Add(subItem); 265item.SubItems.Remove(subItem); 298item.SubItems.Add(subItem); 317item.SubItems.Add(subItem); 356item.SubItems.Remove(subItem); 373item.SubItems.Add(subItem); 377item.SubItems.Remove(subItem); 424item.SubItems.Add(subItem); 443item.SubItems.Add(subItem);
System\Windows\Forms\ListViewTests.cs (3)
5437item.SubItems.Add("Sub1"); 5438item.SubItems.Add("Sub2"); 5447Point subItemLocation = listView.Items[0].SubItems[subItemIndex].Bounds.Location + new Size(1, 1);
System.Windows.Forms.UI.IntegrationTests (49)
ListViewTests.cs (49)
129AccessibleObject? expectedAccessibleObject = listView.Items[itemIndex].SubItems[subItemIndex].AccessibilityObject; 167AccessibleObject? accessibleObject = listView.Items[0].SubItems[1].AccessibilityObject; 213Assert.Equal(listView.Items[0].SubItems[1].AccessibilityObject, accessibleObject.GetChild(0)); 252Assert.Equal(expected1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[0].AccessibilityObject)); 253Assert.Equal(expected2, accessibleObject.GetChildIndex(listView.Items[0].SubItems[1].AccessibilityObject)); 267AccessibleObject? accessibleObject1 = listView.Items[0].SubItems[1].AccessibilityObject; 272Assert.Equal(listView.Items[0].SubItems[2].AccessibilityObject, accessibleObject2); 273Assert.Equal(listView.Items[0].SubItems[3].AccessibilityObject, accessibleObject3); 289AccessibleObject? expectedAccessibleItem1 = listView.Items[0].SubItems[1].AccessibilityObject; 290AccessibleObject? expectedAccessibleItem2 = listView.Items[0].SubItems[2].AccessibilityObject; 313AccessibleObject? accessibleObject = listView.Items[0].SubItems[1].AccessibilityObject; 352Assert.Equal(listView.Items[0].SubItems[1].AccessibilityObject, accessibleObject.GetChild(0)); 353Assert.Equal(listView.Items[0].SubItems[2].AccessibilityObject, accessibleObject.GetChild(1)); 354Assert.Equal(listView.Items[0].SubItems[3].AccessibilityObject, accessibleObject.GetChild(2)); 372Assert.Equal(listView.Items[0].SubItems[1].AccessibilityObject, accessibleObject.GetChild(0)); 373Assert.Equal(listView.Items[0].SubItems[2].AccessibilityObject, accessibleObject.GetChild(1)); 374Assert.Equal(listView.Items[0].SubItems[3].AccessibilityObject, accessibleObject.GetChild(2)); 375Assert.Equal(listView.Items[0].SubItems[4].AccessibilityObject, accessibleObject.GetChild(3)); 376Assert.Equal(listView.Items[0].SubItems[5].AccessibilityObject, accessibleObject.GetChild(4)); 393Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[0].AccessibilityObject)); 394Assert.Equal(1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[1].AccessibilityObject)); 395Assert.Equal(2, accessibleObject.GetChildIndex(listView.Items[0].SubItems[2].AccessibilityObject)); 396Assert.Equal(3, accessibleObject.GetChildIndex(listView.Items[0].SubItems[3].AccessibilityObject)); 412Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[0].AccessibilityObject)); 413Assert.Equal(1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[1].AccessibilityObject)); 414Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[2].AccessibilityObject)); 415Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[3].AccessibilityObject)); 416Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[4].AccessibilityObject)); 431Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[0].AccessibilityObject)); 432Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[1].AccessibilityObject)); 433Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[2].AccessibilityObject)); 449Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[0].AccessibilityObject)); 450Assert.Equal(1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[1].AccessibilityObject)); 451Assert.Equal(2, accessibleObject.GetChildIndex(listView.Items[0].SubItems[2].AccessibilityObject)); 452Assert.Equal(3, accessibleObject.GetChildIndex(listView.Items[0].SubItems[3].AccessibilityObject)); 453Assert.Equal(4, accessibleObject.GetChildIndex(listView.Items[0].SubItems[4].AccessibilityObject)); 454Assert.Equal(5, accessibleObject.GetChildIndex(listView.Items[0].SubItems[5].AccessibilityObject)); 455Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[6].AccessibilityObject)); 456Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[7].AccessibilityObject)); 457Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[8].AccessibilityObject)); 458Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[9].AccessibilityObject)); 459Assert.Equal(-1, accessibleObject.GetChildIndex(listView.Items[0].SubItems[10].AccessibilityObject)); 472Assert.Equal(listView.Items[0].SubItems[0].AccessibilityObject?.Column, -1); 473Assert.Equal(listView.Items[0].SubItems[1].AccessibilityObject?.Column, -1); 474Assert.Equal(listView.Items[0].SubItems[2].AccessibilityObject?.Column, -1); 475Assert.Equal(listView.Items[0].SubItems[2].AccessibilityObject?.Column, -1); 494Point listViewCenter = GetCenter(listView.RectangleToScreen(listView.Items[0].SubItems[1].Bounds)); 500listViewCenter = GetCenter(listView.RectangleToScreen(listView.Items[2].SubItems[1].Bounds)); 559listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem() { Text = $"Test SubItem{i}" });
WinFormsControlsTest (18)
ListViewTest.cs (9)
87item1.SubItems.Add("1"); 88item1.SubItems.Add("2"); 89item1.SubItems.Add("3"); 91item2.SubItems.Add("4"); 92item2.SubItems.Add("5"); 93item2.SubItems.Add("6"); 99item3.SubItems.Add("7"); 100item3.SubItems.Add("8"); 101item3.SubItems.Add("9");
MultipleControls.cs (9)
49item1.SubItems.Add("sub1"); 50item1.SubItems.Add("sub2"); 51item1.SubItems.Add("sub3"); 53item2.SubItems.Add("sub4"); 54item2.SubItems.Add("sub5"); 55item2.SubItems.Add("sub6"); 61item3.SubItems.Add("sub7"); 62item3.SubItems.Add("sub8"); 63item3.SubItems.Add("sub9");