19 writes to Index
System.Windows.Forms (19)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (4)
5199Columns[columnIndex].Index = Columns[columnIndex].Index - 1; 5210Columns[columnIndex].Index = columnIndex; 5360dataGridViewRow.Index--; 5386dataGridViewRow.Index += insertionCount;
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (1)
728dataGridViewBand.Index = -1;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.cs (3)
164dataGridViewColumn.Index = index; 254dataGridViewColumn.Index = index; 900dataGridViewColumn.Index = columnIndex;
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (1)
1144Index = -1;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (10)
130dataGridViewRow.Index = index; 138newDataGridViewRow.Index = index; 263dataGridViewRow.Index = index; 452dataGridViewRow.Index = index; 773dataGridViewRow.Index = index; 1553dataGridViewRow.Index = rowIndex; 1824dataGridViewRow.Index = rowIndexInserted; 2390dataGridViewRow1.Index = rowIndex2; 2395dataGridViewRow2.Index = rowIndex1; 2421SharedRow(rowIndex).Index = rowIndex;
477 references to Index
PresentationUI (4)
MS\Internal\Documents\RMPublishingDialog.cs (1)
575if (row.Index > 0)
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (3)
179if (row.Index > 0) 297FirstDisplayedScrollingRowIndex = row.Index; 769int rowIndex = row.Index;
System.Windows.Forms (443)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (5)
922previousModes[dataGridViewColumn.Index] = dataGridViewColumn.InheritedAutoSizeMode; 2376firstDisplayedColumnIndex = dataGridViewColumn.Index; 2385int firstDisplayedColumnIndexDbg1 = (dataGridViewColumnDbg1 is null) ? -1 : dataGridViewColumnDbg1.Index; 2391firstDisplayedColumnIndexDbg2 = dataGridViewColumnDbg.Index; 3593if (!ScrollIntoView(dataGridViewColumn.Index, firstVisibleRowIndex, false))
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (1)
1224columnIndex = dataGridViewColumn.Index;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (235)
316int preferredThickness = dataGridViewRow.Cells[dataGridViewColumn.Index].GetPreferredWidth( 572if (dataGridViewColumnTmp.Index != dataGridViewColumn.Index) 607if (dataGridViewColumnTmp.Index != dataGridViewColumn.Index 639if (dataGridViewColumnTmp.Index == dataGridViewColumn.Index) 658if (dataGridViewColumnTmp.Index != dataGridViewColumn.Index 716if (dataGridViewColumnTmp.Index != dataGridViewColumn.Index) 718if (Columns.DisplayInOrder(dataGridViewColumn.Index, dataGridViewColumnTmp.Index)) 762if (dataGridViewColumnTmp.Index != dataGridViewColumn.Index 765&& Columns.DisplayInOrder(dataGridViewColumn.Index, dataGridViewColumnTmp.Index)) 803if (dataGridViewColumnTmp.Index == dataGridViewColumn.Index 804|| Columns.DisplayInOrder(dataGridViewColumnTmp.Index, dataGridViewColumn.Index)) 806dataGridViewColumnTmp.UsedFillWeight = dataGridViewColumnTmp.Index == dataGridViewColumn.Index 826if (Columns.DisplayInOrder(dataGridViewColumn.Index, dataGridViewColumnTmp.Index) 1415if (!dataGridViewRow.Cells[dataGridViewColumn.Index].Selected) 1443if (!_selectedBandIndexes.Contains(dataGridViewColumn.Index)) 1450if (!dataGridViewRow.Cells[dataGridViewColumn.Index].Selected) 1488if (!dataGridViewRow.Cells[dataGridViewColumn.Index].Selected) 1668ret |= AutoResizeColumnInternal(dataGridViewColumn.Index, inheritedAutoSizeColumnCriteria, fixedHeight); 3614if (firstVisibleFrozenColumn.Index == dataGridViewColumn.Index) 3619Debug.Assert(Columns.DisplayInOrder(firstVisibleFrozenColumn.Index, dataGridViewColumn.Index)); 3620return Columns.GetColumnCount(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen, firstVisibleFrozenColumn.Index, dataGridViewColumn.Index) < DisplayedBandsInfo.NumDisplayedFrozenCols; 3627if (firstDisplayedScrollingColumnIndex == dataGridViewColumn.Index) 3632if (Columns.DisplayInOrder(firstDisplayedScrollingColumnIndex, dataGridViewColumn.Index)) 3634return Columns.GetColumnCount(DataGridViewElementStates.Visible, firstDisplayedScrollingColumnIndex, dataGridViewColumn.Index) < DisplayedBandsInfo.NumDisplayedScrollingCols; 3673previousColumnIndex = dataGridViewColumnPrev.Index; 3695&& (dataGridViewColumnNext is null || _trackColumn != dataGridViewColumnNext.Index)) 4229return (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 4263return dataGridViewColumn.Index; 4269return dataGridViewColumn.Index; 4600firstDisplayedFrozenCol = dataGridViewColumn.Index; 4605lastDisplayedFrozenCol = dataGridViewColumn.Index; 4637firstDisplayedScrollingCol = dataGridViewColumn.Index; 4689firstDisplayedScrollingCol = dataGridViewColumn.Index; 4707firstDisplayedScrollingCol = dataGridViewColumn.Index; 4751DisplayedBandsInfo.LastTotallyDisplayedScrollingCol = dataGridViewColumn.Index; 4941Debug.Assert(dataGridViewColumn.Index >= 0); 5090while (dataGridViewColumnTmp is not null && Columns.DisplayInOrder(dataGridViewColumnTmp.Index, dataGridViewColumn.Index)) 5124while (dataGridViewColumnTmp is not null && Columns.DisplayInOrder(dataGridViewColumn.Index, dataGridViewColumnTmp.Index)) 5197for (int columnIndex = dataGridViewColumn.Index; columnIndex < Columns.Count; columnIndex++) 5199Columns[columnIndex].Index = Columns[columnIndex].Index - 1; 5200Debug.Assert(Columns[columnIndex].Index == columnIndex); 5208for (int columnIndex = dataGridViewColumn.Index + insertionCount; columnIndex < Columns.Count; columnIndex++) 5358if (dataGridViewRow.Index >= 0) 5361Debug.Assert(dataGridViewRow.Index == rowIndex); 5384if (dataGridViewRow.Index >= 0) 5387Debug.Assert(dataGridViewRow.Index == rowIndex); 5469Debug.Assert(dataGridViewRow.Index == -1); 5643rectInsertionBar.X = GetColumnXFromIndex(Columns.GetFirstColumn(DataGridViewElementStates.Visible)!.Index); 6339if (dataGridViewRow.Index == -1) 6720columnIndexTmp = (dataGridViewColumnTmp is null) ? -1 : dataGridViewColumnTmp.Index; 7306.Cells[dataGridViewColumn.Index] 7324.Cells[dataGridViewColumn.Index] 7380.Cells[dataGridViewColumn.Index] 7398.Cells[dataGridViewColumn.Index] 7601.Cells[dataGridViewColumn.Index] 7619.Cells[dataGridViewColumn.Index] 7679.Cells[dataGridViewColumn.Index] 7697.Cells[dataGridViewColumn.Index] 7851if (lColumn is null || Columns.DisplayInOrder(columnIndex, lColumn.Index)) 7856if (uColumn is null || Columns.DisplayInOrder(uColumn.Index, columnIndex)) 7882if (lColumn is null || Columns.DisplayInOrder(dataGridViewCell.ColumnIndex, lColumn.Index)) 7887if (uColumn is null || Columns.DisplayInOrder(uColumn.Index, dataGridViewCell.ColumnIndex)) 7898Debug.Assert(lColumn.Index == uColumn.Index || Columns.DisplayInOrder(lColumn.Index, uColumn.Index)); 8047.Cells[dataGridViewColumn.Index] 8117.Cells[dataGridViewColumn.Index] 8226if (dataGridViewColumn.Index == columnIndex) 8257if (dataGridViewColumn.Index == columnIndex) 8272if (dataGridViewColumn.Index == DisplayedBandsInfo.FirstDisplayedScrollingCol) 8295if (dataGridViewColumn.Index == DisplayedBandsInfo.FirstDisplayedScrollingCol) 8358return dataGridViewColumn.Index; 8363return dataGridViewColumn.Index; 8400return dataGridViewColumn.Index; 8405return dataGridViewColumn.Index; 8463if (index == dataGridViewColumn.Index) 8501if (index == dataGridViewColumn.Index) 8537if (index == dataGridViewColumn.Index) 8617firstColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 8700int firstUnfrozenColumnIndex = Columns.GetFirstColumn(DataGridViewElementStates.Visible, DataGridViewElementStates.Frozen)!.Index; 9381hti._adjacentCol = dataGridViewColumn.Index; 9529hti._adjacentCol = dataGridViewColumn.Index; 9558if (hti._col == dataGridViewColumn.Index 10464InvalidateColumnInternal(dataGridViewColumn.Index); 10486InvalidateColumnInternal(dataGridViewColumn.Index); 10535Debug.Assert(dataGridViewColumn.Index >= 0); 10542dataGridViewColumn.DisplayIndexInternal = dataGridViewColumn.Index; 10553AdjustExpandingRows(dataGridViewColumn.Index, fixedWidth: false); 10560AutoResizeColumnHeadersHeight(dataGridViewColumn.Index, fixedRowHeadersWidth: true, fixedColumnWidth); 10568dataGridViewColumn.Index, 10576dataGridViewColumn.Index, 10605Debug.Assert(dataGridViewRowDebug.Index != -1 || !dataGridViewCell.HasValue); 10724OnAddedRow_PreNotification(dataGridViewRow.Index); 10732OnAddedRow_PostNotification(dataGridViewRow.Index); 11192dataGridViewColumn.Index, 11216AutoResizeColumnHeadersHeight(dataGridViewColumn.Index, fixedRowHeadersWidth: true, fixedColumnWidth: true); 11223dataGridViewColumn.Index, 11249DataGridViewAutoSizeColumnMode previousInheritedMode = previousModes[dataGridViewColumn.Index]; 11271dataGridViewColumn.Index, 11309dataGridViewColumn.Index, 12091hti._col = dataGridViewLastVisibleColumn.Index; 13327InvalidateColumnInternal(e.Column.Index); 13341OnColumnGlobalAutoSize(e.Column.Index); 13489OnColumnGlobalAutoSize(e.Column.Index); 13576OnColumnHeaderGlobalAutoSize(e.Column.Index); 14071InvalidateCellPrivate(dataGridViewColumn.Index, -1); 14078AutoResizeColumnHeadersHeight(dataGridViewColumn.Index, fixedRowHeadersWidth: true, fixedColumnWidth); 14084AutoResizeColumnInternal(dataGridViewColumn.Index, autoSizeColumnCriteriaInternal, fixedHeight); 14089AutoResizeColumnInternal(dataGridViewColumn.Index, autoSizeColumnCriteriaInternal, fixedHeight: true); 14095AutoResizeColumnHeadersHeight(dataGridViewColumn.Index, fixedRowHeadersWidth: true, fixedColumnWidth: true); 14136SelectColumnRange(dataGridViewColumn.Index, hti._col, true); 14143SelectColumnRange(dataGridViewColumn.Index, _trackColumnEdge, false); 14150SelectColumnRange(dataGridViewColumn.Index, hti._col, true); 14157SelectColumnRange(hti._col, dataGridViewColumn.Index, true); 14164SelectColumnRange(_trackColumnEdge, dataGridViewColumn.Index, false); 14171SelectColumnRange(hti._col, dataGridViewColumn.Index, true); 14178SelectColumnRange(dataGridViewColumn.Index, _trackColumnEdge, false); 14181SelectColumnRange(hti._col, dataGridViewColumn.Index, true); 14188SelectColumnRange(_trackColumnEdge, dataGridViewColumn.Index, false); 14191SelectColumnRange(dataGridViewColumn.Index, hti._col, true); 14274AutoResizeColumnHeadersHeight(dataGridViewColumn.Index, fixedRowHeadersWidth: true, fixedColumnWidth); 14280AutoResizeColumnInternal(dataGridViewColumn.Index, autoSizeColumnCriteriaInternal, fixedHeight); 14285AutoResizeColumnInternal(dataGridViewColumn.Index, autoSizeColumnCriteriaInternal, fixedHeight: true); 14291AutoResizeColumnHeadersHeight(dataGridViewColumn.Index, fixedRowHeadersWidth: true, fixedColumnWidth: true); 14313InvalidateColumnInternal(dataGridViewColumn.Index); 14326Debug.Assert(Columns.DisplayInOrder(dataGridViewColumn.Index, DisplayedBandsInfo.FirstDisplayedScrollingCol)); 14390AutoResizeColumnInternal(dataGridViewColumn.Index, (DataGridViewAutoSizeColumnCriteriaInternal)autoSizeColumnMode, fixedHeight: !autoSizeRows); 14404AdjustExpandingRows(dataGridViewColumn.Index, fixedWidth: true); 14414AutoResizeColumnInternal(dataGridViewColumn.Index, (DataGridViewAutoSizeColumnCriteriaInternal)autoSizeColumnMode, fixedHeight: true); 14428&& dataGridViewColumn.Index == _ptCurrentCell.X 14492int leftEdge = GetColumnXFromIndex(e.Column.Index); 14511PositionEditingControl(_ptCurrentCell.X != e.Column.Index, true, false); 14527OnColumnGlobalAutoSize(e.Column.Index); 14653if (Events[s_rowStateChangedEvent] is DataGridViewRowStateChangedEventHandler eh && dataGridViewRow.DataGridView is not null && dataGridViewRow.Index == -1) 14660OnRowStateChanged(dataGridViewRow.Index == -1 ? index : dataGridViewRow.Index, dgvrsce); 14713else if (dataGridViewColumn.Visible && _ptCurrentCell.X == dataGridViewColumn.Index) 14734if (_ptCurrentCell.X == dataGridViewColumn.Index 14769int rowIndex = ((dataGridViewRow.Index > -1) ? dataGridViewRow.Index : index); 15248DisplayedBandsInfo.CorrectColumnIndexAfterInsertion(dataGridViewColumn.Index, 1); 16860Debug.Assert(dataGridViewColumn.Index >= 0); 16875DisplayedBandsInfo.CorrectRowIndexAfterDeletion(dataGridViewColumn.Index); 17013Debug.Assert(dataGridViewColumn.Index >= 0 && dataGridViewColumn.Index < Columns.Count); 17016int columnIndex = dataGridViewColumn.Index; 17031newX = dataGridViewColumnNext.Index > columnIndex 17032? dataGridViewColumnNext.Index - 1 17033: dataGridViewColumnNext.Index; 17043? dataGridViewColumnPrevious.Index > columnIndex 17044? dataGridViewColumnPrevious.Index - 1 17045: dataGridViewColumnPrevious.Index 17150if (DisplayedBandsInfo.FirstDisplayedScrollingCol == dataGridViewColumn.Index) 17156else if (Columns.DisplayInOrder(DisplayedBandsInfo.FirstDisplayedScrollingCol, dataGridViewColumn.Index)) 17376OnCellCommonChange(columnIndex, dataGridViewRow.Index); 17392if (_ptCurrentCell.X == dataGridViewRow.Index && _ptCurrentCell.Y == columnIndex) 17593OnRowGlobalAutoSize(e.Row.Index); 17631OnRowGlobalAutoSize(e.Row.Index); 17753UpdateRowErrorText(e.Row.Index); 17837OnRowHeaderGlobalAutoSize(e.Row.Index); 18114if (IsInnerCellOutOfBounds(dataGridViewColumn.Index, hti._row)) 18120bool success = ScrollIntoView(dataGridViewColumn.Index, hti._row, false); 18122if (IsInnerCellOutOfBounds(dataGridViewColumn.Index, hti._row)) 18127success = SetCurrentCellAddressCore(dataGridViewColumn.Index, hti._row, !selectRowRange, false, true); 18270UpdateRowHeightInfoPrivate(e.Row.Index, updateToEnd: false, invalidInAdjustFillingColumns: false); 18272OnRowGlobalAutoSize(e.Row.Index); 18630if (dataGridViewRow.Index == -1) 18688if (_ptCurrentCell.X != -1 && dataGridViewRow.Index == _ptCurrentCell.Y && EditingControl is not null) 20003Debug.Assert(dataGridViewRow.Index == -1); 20015Debug.Assert(dataGridViewRow.Index == -1); 20145int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 21068int lastVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 21543int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 22069int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 22084previousVisibleColumnIndex = dataGridViewColumn.Index; 22915int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 23174int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 23443int lastVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 23458nextVisibleColumnIndex = dataGridViewColumn.Index; 24523int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 25554if (column.Selected && (!_selectedBandIndexes.Contains(column.Index))) 25556_selectedBandIndexes.Add(column.Index); 26062DataGridViewElementStates.None)!.Index; 26083DataGridViewElementStates.None)!.Index; 26615_ptAnchorCell.X = dataGridViewColumn.Index; 27168columnIndex = dataGridViewColumn.Index; 27197columnIndex = dataGridViewColumn.Index; 27284columnIndex = dataGridViewColumn.Index; 28480int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 28495nextVisibleColumnIndex = dataGridViewColumn.Index; 28641int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 28656previousVisibleColumnIndex = dataGridViewColumn.Index; 28670int lastVisibleColumnIndex = dataGridViewColumn.Index; 29236dataGridViewColumn.Index, 29246dataGridViewColumn.Index, 29265dataGridViewColumn.Index, 29275dataGridViewColumn.Index, 29334dataGridViewColumn.Index, 29355dataGridViewColumn.Index, 29396dataGridViewColumn.Index, 29420dataGridViewColumn.Index, 29439dataGridViewColumn.Index, 29479dataGridViewColumn.Index, 29501dataGridViewColumn.Index, 29510dataGridViewColumn.Index, 29533dataGridViewColumn.Index, 29560dataGridViewColumn.Index, 29578dataGridViewColumn.Index, 29608dataGridViewColumn.Index, 29623dataGridViewColumn.Index, 29652dataGridViewColumn.Index, 29661dataGridViewColumn.Index, 29679dataGridViewColumn.Index, 29705dataGridViewColumn.Index, 29727dataGridViewColumn.Index, 29753dataGridViewColumn.Index, 29772dataGridViewColumn.Index,
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (18)
48return ((DataGridViewRow)this).GetContextMenuStrip(Index); 349if (IsRow && Index > -1) 351GetHeightInfo(Index, out int height, out int minimumHeight); 419if (Index == -1) 425DataGridView.SetReadOnlyRowCore(Index, value); 429Debug.Assert(Index >= 0); 431DataGridView.SetReadOnlyColumnCore(Index, value); 550if (Index == -1) 557DataGridView.SetSelectedRowCoreInternal(Index, value); 562Debug.Assert(Index >= 0); 565DataGridView.SetSelectedColumnCoreInternal(Index, value); 610if (IsRow && Index > -1) 612GetHeightInfo(Index, out int height, out int minimumHeight); 696DataGridView.NewRowIndex == Index && 729if (!IsRow || Index >= 0 || DataGridView is null) 811if (Index != -1) 832if (Index != -1) 866public override string ToString() => $"DataGridViewBand {{ Index={Index} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonColumn.cs (9)
87if (dataGridViewRow.Cells[Index] is DataGridViewButtonCell dataGridViewCell) 93DataGridView.OnColumnCommonChange(Index); 121DataGridView.OnColumnCommonChange(Index); 130if (dataGridViewRow.Cells[Index] is DataGridViewButtonCell dataGridViewCell && dataGridViewCell.UseColumnTextForButtonValue) 132DataGridView.OnColumnCommonChange(Index); 137DataGridView.InvalidateColumn(Index); 175if (dataGridViewRow.Cells[Index] is DataGridViewButtonCell dataGridViewCell) 181DataGridView.OnColumnCommonChange(Index); 230$"DataGridViewButtonColumn {{ Name={Name}, Index={Index} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (5)
102public int ColumnIndex => OwningColumn?.Index ?? -1; 526public int RowIndex => OwningRow?.Index ?? -1; 982bool isLastVisibleColumn = (dataGridViewColumn is not null && dataGridViewColumn.Index == ColumnIndex); 1865Debug.Assert(state == stateDebug || DataGridView.Rows.SharedRow(rowIndex).Index == -1); 3909if (OwningRow.Index == DataGridView.CurrentCellAddress.Y)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.DataGridViewCellAccessibleObject.cs (13)
158cellBounds = _owner.DataGridView.GetCellDisplayRectangle(_owner.OwningColumn.Index, _owner.OwningRow.Index, cutOverflow: false); 162cellBounds = _owner.DataGridView.GetCellDisplayRectangle(-1, _owner.OwningRow.Index, cutOverflow: false); 166cellBounds = _owner.DataGridView.GetCellDisplayRectangle(_owner.OwningColumn.Index, -1, cutOverflow: false); 242_owner.OwningRow.Index, 467if (_owner.OwningRow.Index == _owner.DataGridView.Rows.GetFirstRow(DataGridViewElementStates.Visible)) 475int previousVisibleRow = _owner.DataGridView.Rows.GetPreviousRow(_owner.OwningRow.Index, DataGridViewElementStates.Visible); 476return _owner.DataGridView.Rows[previousVisibleRow].Cells[_owner.OwningColumn.Index].AccessibilityObject; 480if (_owner.OwningRow.Index == _owner.DataGridView.Rows.GetLastRow(DataGridViewElementStates.Visible)) 486int nextVisibleRow = _owner.DataGridView.Rows.GetNextRow(_owner.OwningRow.Index, DataGridViewElementStates.Visible); 487return _owner.DataGridView.Rows[nextVisibleRow].Cells[_owner.OwningColumn.Index].AccessibilityObject; 527DataGridViewElementStates.None)!.Index; 560DataGridViewElementStates.None)!.Index;
System\Windows\Forms\Controls\DataGridView\DataGridViewCellCollection.cs (2)
128return _items[dataGridViewColumn.Index]; 143this[dataGridViewColumn.Index] = value;
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxColumn.cs (11)
91if (dataGridViewRow.Cells[Index] is DataGridViewCheckBoxCell dataGridViewCell) 97DataGridView.InvalidateColumn(Index); 134if (dataGridViewRow.Cells[Index] is DataGridViewCheckBoxCell dataGridViewCell) 140DataGridView.OnColumnCommonChange(Index); 178if (dataGridViewRow.Cells[Index] is DataGridViewCheckBoxCell dataGridViewCell) 184DataGridView.InvalidateColumn(Index); 218if (dataGridViewRow.Cells[Index] is DataGridViewCheckBoxCell dataGridViewCell) 224DataGridView.InvalidateColumn(Index); 272if (dataGridViewRow.Cells[Index] is DataGridViewCheckBoxCell dataGridViewCell) 278DataGridView.InvalidateColumn(Index); 316$"DataGridViewCheckBoxColumn {{ Name={Name}, Index={Index} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (8)
910Debug.Assert(dataGridView is null || Index > -1); 956preferredCellThickness = dataGridViewRow.Cells[Index].GetPreferredWidth(rowIndex, dataGridViewRow.Thickness); 960preferredCellThickness = dataGridViewRow.Cells[Index].GetPreferredSize(rowIndex).Width; 980preferredCellThickness = dataGridViewRow.Cells[Index].GetPreferredWidth(rowIndex, dataGridViewRow.Thickness); 984preferredCellThickness = dataGridViewRow.Cells[Index].GetPreferredSize(rowIndex).Width; 1005preferredCellThickness = dataGridViewRow.Cells[Index].GetPreferredWidth(rowIndex, dataGridViewRow.Thickness); 1009preferredCellThickness = dataGridViewRow.Cells[Index].GetPreferredSize(rowIndex).Width; 1027$"DataGridViewColumn {{ Name={Name}, Index={Index} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.cs (10)
123return dataGridViewColumn?.Index ?? -1; 320while (dataGridViewColumn is not null && dataGridViewColumn.Index != columnIndex) 519if (dataGridViewColumn.Index == _itemsSorted[index].Index) 752dataGridViewColumn.Index > dataGridViewColumnStart.Index))) 756dataGridViewColumn.Index < indexMin)) 825dataGridViewColumn.Index < dataGridViewColumnStart.Index))) 829dataGridViewColumn.Index > indexMax))
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnEventArgs.cs (1)
12Debug.Assert(dataGridViewColumn.Index >= -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (3)
1755bool isFirstDisplayedColumn = OwningColumn.Index == DataGridView.FirstDisplayedColumnIndex; 1756bool isFirstDisplayedScrollingColumn = OwningColumn.Index == DataGridView.FirstDisplayedScrollingColumnIndex; 1767Rectangle cellBounds = DataGridView.GetCellDisplayRectangle(OwningColumn.Index, rowIndex, cutOverflow: false);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxColumn.cs (19)
57if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 123if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 129DataGridView.OnColumnCommonChange(Index); 169if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 175DataGridView.OnColumnCommonChange(Index); 212if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 219DataGridView.InvalidateColumn(Index); 256if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 263DataGridView.InvalidateColumn(Index); 300if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 341if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 347DataGridView.OnColumnCommonChange(Index); 404if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 410DataGridView.OnColumnCommonChange(Index); 447if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 488if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 531if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 538DataGridView.OnColumnCommonChange(Index); 544$"DataGridViewComboBoxColumn {{ Name={Name}, Index={Index} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (1)
302if (OwningRow is null || OwningRow.Index != -1)
System\Windows\Forms\Controls\DataGridView\DataGridViewImageColumn.cs (8)
98if (dataGridViewRow.Cells[Index] is DataGridViewImageCell dataGridViewCell) 114DataGridView?.OnColumnCommonChange(Index); 127DataGridView?.OnColumnCommonChange(Index); 172if (dataGridViewRow.Cells[Index] is DataGridViewImageCell dataGridViewCell) 178DataGridView.OnColumnCommonChange(Index); 212if (dataGridViewRow.Cells[Index] is DataGridViewImageCell dataGridViewCell) 218DataGridView.OnColumnCommonChange(Index); 292$"DataGridViewImageColumn {{ Name={Name}, Index={Index} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkColumn.cs (17)
56if (dataGridViewRow.Cells[Index] is DataGridViewLinkCell dataGridViewCell) 62DataGridView.InvalidateColumn(Index); 125if (dataGridViewRow.Cells[Index] is DataGridViewLinkCell dataGridViewCell) 131DataGridView.InvalidateColumn(Index); 167if (dataGridViewRow.Cells[Index] is DataGridViewLinkCell dataGridViewCell) 173DataGridView.InvalidateColumn(Index); 208DataGridView.OnColumnCommonChange(Index); 217if (dataGridViewRow.Cells[Index] is DataGridViewLinkCell dataGridViewCell && dataGridViewCell.UseColumnTextForLinkValue) 219DataGridView.OnColumnCommonChange(Index); 224DataGridView.InvalidateColumn(Index); 262if (dataGridViewRow.Cells[Index] is DataGridViewLinkCell dataGridViewCell) 268DataGridView.InvalidateColumn(Index); 305if (dataGridViewRow.Cells[Index] is DataGridViewLinkCell dataGridViewCell) 311DataGridView.OnColumnCommonChange(Index); 347if (dataGridViewRow.Cells[Index] is DataGridViewLinkCell dataGridViewCell) 353DataGridView.InvalidateColumn(Index); 388$"DataGridViewLinkColumn {{ Name={Name}, Index={Index} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (39)
73&& Index > -1 74&& Index != DataGridView.NewRowIndex) 76return DataGridView.DataConnection.CurrencyManager[Index]; 96if (DataGridView is not null && Index == -1) 110if (DataGridView is not null && Index == -1) 115return GetDisplayed(Index); 128if (DataGridView is not null && Index == -1) 145Debug.Assert(Index >= -1); 146return GetErrorText(Index); 181if (DataGridView is not null && Index == -1) 186return GetFrozen(Index); 190if (DataGridView is not null && Index == -1) 218if (DataGridView is not null && Index == -1) 231if (Index == -1) 237BuildInheritedRowStyle(Index, inheritedRowStyle); 248get => DataGridView is not null && DataGridView.NewRowIndex == Index; 258if (DataGridView is not null && Index == -1) 276if (DataGridView is not null && Index == -1) 281return GetReadOnly(Index); 293if (DataGridView is not null && Index == -1) 298return GetResizable(Index); 307if (DataGridView is not null && Index == -1) 312return GetSelected(Index); 321if (DataGridView is not null && Index == -1) 326return GetState(Index); 335if (DataGridView is not null && Index == -1) 340return GetVisible(Index); 344if (DataGridView is not null && Index == -1) 1165Debug.Assert(Index == -1); 1371if (DataGridView is null || DataGridView.Rows.SharedRow(rowIndex).Index != -1) 1373if (rowIndex != Index) 1517cell = Cells[dataGridViewColumn.Index]; 1541if (Index != -1) 1607cell = Cells[dataGridViewColumn.Index]; 1631if (Index != -1) 1749Debug.Assert(Index == -1); 1780if (Index == -1) 1802if (!cells[columnIndex].SetValueInternal(Index, values[columnIndex])) 1819return $"DataGridViewRow {{ Index={Index} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.DataGridViewRowAccessibleObject.cs (8)
54Rectangle rowRect = _owningDataGridViewRow.DataGridView.RectangleToScreen(_owningDataGridViewRow.DataGridView.GetRowDisplayRectangle(_owningDataGridViewRow.Index, cutOverflow: false)); 198Rectangle rowBounds = _owningDataGridViewRow.DataGridView.GetRowDisplayRectangle(_owningDataGridViewRow.Index, cutOverflow: true); 218if (_owningDataGridViewRow.DataGridView is not null && _owningDataGridViewRow.DataGridView.AllowUserToAddRows && _owningDataGridViewRow.Index == _owningDataGridViewRow.DataGridView.NewRowIndex) 316dataGridView.CurrentCell.RowIndex == _owningDataGridViewRow.Index) 342if (_owningDataGridViewRow.Index != _owningDataGridViewRow.DataGridView.Rows.GetLastRow(DataGridViewElementStates.Visible)) 356if (_owningDataGridViewRow.Index != _owningDataGridViewRow.DataGridView.Rows.GetFirstRow(DataGridViewElementStates.Visible)) 422dataGridView.CurrentCell = _owningDataGridViewRow.Cells[dataGridView.CurrentCell.OwningColumn.Index]; // Do not change old selection 426int firstVisibleCell = dataGridView.Columns.GetFirstColumn(DataGridViewElementStates.Visible)!.Index;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (20)
124if (dataGridViewRow.Index == -1) 500if (rowTemplate.Index == -1 && !IsCollectionChangedListenedTo && !newRow) 585if (rowTemplate.Index == -1) 704Debug.Assert(dataGridViewRow.Index == -1); 1335if (dataGridViewRow.Index == -1) 1341Debug.Assert(dataGridViewRow.Index == rowIndex); 1613if (rowTemplate.Index == -1) 1733Debug.Assert(dataGridViewRow.Index == -1); 1916originalIndex = SharedRow(rowIndex).Index; 1920if (originalIndex == -1 && SharedRow(rowIndex).Index != -1) 1942originalIndex = SharedRow(rowIndex).Index; 1946if (originalIndex == -1 && SharedRow(rowIndex).Index != -1) 2151if (dataGridViewRow.Index == -1) 2157RemoveAt(dataGridViewRow.Index); 2227if (dataGridViewRow.Index != -1) 2243Debug.Assert(dataGridViewRow.Index == -1); 2263if (dataGridViewRow.Index != -1) 2292if (dataGridViewRow.Index == -1) 2388if (dataGridViewRow1.Index != -1) 2393if (dataGridViewRow2.Index != -1)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.RowComparer.cs (1)
32_sortedColumnIndex = _dataGridViewSortedColumn.Index;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.DataGridViewRowHeaderCellAccessibleObject.cs (4)
155if (Owner.OwningRow.Index == Owner.DataGridView.Rows.GetLastRow(DataGridViewElementStates.Visible)) 160int nextVisibleRow = Owner.DataGridView.Rows.GetNextRow(Owner.OwningRow.Index, DataGridViewElementStates.Visible); 174if (Owner.OwningRow.Index == Owner.DataGridView.Rows.GetFirstRow(DataGridViewElementStates.Visible)) 187int previousVisibleRow = Owner.DataGridView.Rows.GetPreviousRow(Owner.OwningRow.Index, DataGridViewElementStates.Visible);
System\Windows\Forms\Controls\DataGridView\DataGridViewSortCompareEventArgs.cs (1)
18Debug.Assert(dataGridViewColumn.Index >= 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxColumn.cs (2)
68if (dataGridViewRow.Cells[Index] is DataGridViewTextBoxCell dataGridViewCell) 86$"DataGridViewTextBoxColumn {{ Name={Name}, Index={Index} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.DataGridViewTopLeftHeaderCellAccessibleObject.cs (2)
219col.Index, 220row.Index,
System.Windows.Forms.Tests (27)
System\Windows\Forms\DataGridViewCellTests.cs (1)
577Assert.Equal(columnVisible, row.Index != -1);
System\Windows\Forms\DataGridViewColumnCollectionTests.cs (22)
47Assert.Equal(0, column1.Index); 55Assert.Equal(0, column1.Index); 58Assert.Equal(1, column2.Index); 75Assert.Equal(0, column1.Index); 83Assert.Equal(0, column1.Index); 86Assert.Equal(1, column2.Index); 125Assert.Equal(0, column1.Index); 133Assert.Equal(0, column1.Index); 136Assert.Equal(1, column2.Index); 199Assert.Equal(0, column1.Index); 207Assert.Equal(0, column1.Index); 210Assert.Equal(1, column2.Index); 233Assert.Equal(0, column1.Index); 241Assert.Equal(0, column1.Index); 244Assert.Equal(1, column2.Index); 275Assert.Equal(0, column1.Index); 283Assert.Equal(0, column1.Index); 286Assert.Equal(1, column2.Index); 294Assert.Equal(0, column1.Index); 297Assert.Equal(1, column2.Index); 300Assert.Equal(2, column3.Index); 319Assert.Equal(0, column.Index);
System\Windows\Forms\DataGridViewColumnTests.cs (3)
34Assert.Equal(column.Index, column.Index); 81Assert.Equal(-1, column.Index);
System\Windows\Forms\DataGridViewRowTests.cs (1)
35Assert.Equal(-1, row.Index);
WinFormsControlsTest (3)
DataGridViewInVirtualModeTest.cs (3)
180if (e.Row.Index < _customers.Count) 184_customers.RemoveAt(e.Row.Index); 187if (e.Row.Index == _rowInEdit)