21 writes to Index
System.Windows.Forms (19)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (4)
5193Columns[columnIndex].Index = Columns[columnIndex].Index - 1; 5204Columns[columnIndex].Index = columnIndex; 5354dataGridViewRow.Index--; 5380dataGridViewRow.Index += insertionCount;
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (1)
722dataGridViewBand.Index = -1;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.cs (3)
163dataGridViewColumn.Index = index; 253dataGridViewColumn.Index = index; 899dataGridViewColumn.Index = columnIndex;
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (1)
1148Index = -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;
System.Windows.Forms.Tests (2)
System\Windows\Forms\DataGridViewSortCompareEventArgsTests.cs (1)
14_column = new DataGridViewTextBoxColumn { Index = 1 };
System\Windows\Forms\DataGridViewTextBoxColumnTests.cs (1)
122_column.Index = 1;
484 references to Index
PresentationUI (4)
MS\Internal\Documents\RMPublishingDialog.cs (1)
566if (row.Index > 0)
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (3)
176if (row.Index > 0) 294FirstDisplayedScrollingRowIndex = row.Index; 773int rowIndex = row.Index;
System.Windows.Forms (443)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (5)
918previousModes[dataGridViewColumn.Index] = dataGridViewColumn.InheritedAutoSizeMode; 2383firstDisplayedColumnIndex = dataGridViewColumn.Index; 2392int firstDisplayedColumnIndexDbg1 = (dataGridViewColumnDbg1 is null) ? -1 : dataGridViewColumnDbg1.Index; 2398firstDisplayedColumnIndexDbg2 = dataGridViewColumnDbg.Index; 3600if (!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)
315int preferredThickness = dataGridViewRow.Cells[dataGridViewColumn.Index].GetPreferredWidth( 571if (dataGridViewColumnTmp.Index != dataGridViewColumn.Index) 606if (dataGridViewColumnTmp.Index != dataGridViewColumn.Index 638if (dataGridViewColumnTmp.Index == dataGridViewColumn.Index) 657if (dataGridViewColumnTmp.Index != dataGridViewColumn.Index 715if (dataGridViewColumnTmp.Index != dataGridViewColumn.Index) 717if (Columns.DisplayInOrder(dataGridViewColumn.Index, dataGridViewColumnTmp.Index)) 761if (dataGridViewColumnTmp.Index != dataGridViewColumn.Index 764&& Columns.DisplayInOrder(dataGridViewColumn.Index, dataGridViewColumnTmp.Index)) 802if (dataGridViewColumnTmp.Index == dataGridViewColumn.Index 803|| Columns.DisplayInOrder(dataGridViewColumnTmp.Index, dataGridViewColumn.Index)) 805dataGridViewColumnTmp.UsedFillWeight = dataGridViewColumnTmp.Index == dataGridViewColumn.Index 825if (Columns.DisplayInOrder(dataGridViewColumn.Index, dataGridViewColumnTmp.Index) 1414if (!dataGridViewRow.Cells[dataGridViewColumn.Index].Selected) 1442if (!_selectedBandIndexes.Contains(dataGridViewColumn.Index)) 1449if (!dataGridViewRow.Cells[dataGridViewColumn.Index].Selected) 1487if (!dataGridViewRow.Cells[dataGridViewColumn.Index].Selected) 1667ret |= AutoResizeColumnInternal(dataGridViewColumn.Index, inheritedAutoSizeColumnCriteria, fixedHeight); 3608if (firstVisibleFrozenColumn.Index == dataGridViewColumn.Index) 3613Debug.Assert(Columns.DisplayInOrder(firstVisibleFrozenColumn.Index, dataGridViewColumn.Index)); 3614return Columns.GetColumnCount(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen, firstVisibleFrozenColumn.Index, dataGridViewColumn.Index) < DisplayedBandsInfo.NumDisplayedFrozenCols; 3621if (firstDisplayedScrollingColumnIndex == dataGridViewColumn.Index) 3626if (Columns.DisplayInOrder(firstDisplayedScrollingColumnIndex, dataGridViewColumn.Index)) 3628return Columns.GetColumnCount(DataGridViewElementStates.Visible, firstDisplayedScrollingColumnIndex, dataGridViewColumn.Index) < DisplayedBandsInfo.NumDisplayedScrollingCols; 3667previousColumnIndex = dataGridViewColumnPrev.Index; 3689&& (dataGridViewColumnNext is null || _trackColumn != dataGridViewColumnNext.Index)) 4223return (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 4257return dataGridViewColumn.Index; 4263return dataGridViewColumn.Index; 4594firstDisplayedFrozenCol = dataGridViewColumn.Index; 4599lastDisplayedFrozenCol = dataGridViewColumn.Index; 4631firstDisplayedScrollingCol = dataGridViewColumn.Index; 4683firstDisplayedScrollingCol = dataGridViewColumn.Index; 4701firstDisplayedScrollingCol = dataGridViewColumn.Index; 4745DisplayedBandsInfo.LastTotallyDisplayedScrollingCol = dataGridViewColumn.Index; 4935Debug.Assert(dataGridViewColumn.Index >= 0); 5084while (dataGridViewColumnTmp is not null && Columns.DisplayInOrder(dataGridViewColumnTmp.Index, dataGridViewColumn.Index)) 5118while (dataGridViewColumnTmp is not null && Columns.DisplayInOrder(dataGridViewColumn.Index, dataGridViewColumnTmp.Index)) 5191for (int columnIndex = dataGridViewColumn.Index; columnIndex < Columns.Count; columnIndex++) 5193Columns[columnIndex].Index = Columns[columnIndex].Index - 1; 5194Debug.Assert(Columns[columnIndex].Index == columnIndex); 5202for (int columnIndex = dataGridViewColumn.Index + insertionCount; columnIndex < Columns.Count; columnIndex++) 5352if (dataGridViewRow.Index >= 0) 5355Debug.Assert(dataGridViewRow.Index == rowIndex); 5378if (dataGridViewRow.Index >= 0) 5381Debug.Assert(dataGridViewRow.Index == rowIndex); 5463Debug.Assert(dataGridViewRow.Index == -1); 5637rectInsertionBar.X = GetColumnXFromIndex(Columns.GetFirstColumn(DataGridViewElementStates.Visible)!.Index); 6333if (dataGridViewRow.Index == -1) 6714columnIndexTmp = (dataGridViewColumnTmp is null) ? -1 : dataGridViewColumnTmp.Index; 7301.Cells[dataGridViewColumn.Index] 7319.Cells[dataGridViewColumn.Index] 7375.Cells[dataGridViewColumn.Index] 7393.Cells[dataGridViewColumn.Index] 7596.Cells[dataGridViewColumn.Index] 7614.Cells[dataGridViewColumn.Index] 7674.Cells[dataGridViewColumn.Index] 7692.Cells[dataGridViewColumn.Index] 7846if (lColumn is null || Columns.DisplayInOrder(columnIndex, lColumn.Index)) 7851if (uColumn is null || Columns.DisplayInOrder(uColumn.Index, columnIndex)) 7877if (lColumn is null || Columns.DisplayInOrder(dataGridViewCell.ColumnIndex, lColumn.Index)) 7882if (uColumn is null || Columns.DisplayInOrder(uColumn.Index, dataGridViewCell.ColumnIndex)) 7893Debug.Assert(lColumn.Index == uColumn.Index || Columns.DisplayInOrder(lColumn.Index, uColumn.Index)); 8042.Cells[dataGridViewColumn.Index] 8112.Cells[dataGridViewColumn.Index] 8221if (dataGridViewColumn.Index == columnIndex) 8252if (dataGridViewColumn.Index == columnIndex) 8267if (dataGridViewColumn.Index == DisplayedBandsInfo.FirstDisplayedScrollingCol) 8290if (dataGridViewColumn.Index == DisplayedBandsInfo.FirstDisplayedScrollingCol) 8353return dataGridViewColumn.Index; 8358return dataGridViewColumn.Index; 8395return dataGridViewColumn.Index; 8400return dataGridViewColumn.Index; 8458if (index == dataGridViewColumn.Index) 8496if (index == dataGridViewColumn.Index) 8532if (index == dataGridViewColumn.Index) 8612firstColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 8695int firstUnfrozenColumnIndex = Columns.GetFirstColumn(DataGridViewElementStates.Visible, DataGridViewElementStates.Frozen)!.Index; 9376hti._adjacentCol = dataGridViewColumn.Index; 9524hti._adjacentCol = dataGridViewColumn.Index; 9553if (hti._col == dataGridViewColumn.Index 10459InvalidateColumnInternal(dataGridViewColumn.Index); 10481InvalidateColumnInternal(dataGridViewColumn.Index); 10530Debug.Assert(dataGridViewColumn.Index >= 0); 10537dataGridViewColumn.DisplayIndexInternal = dataGridViewColumn.Index; 10548AdjustExpandingRows(dataGridViewColumn.Index, fixedWidth: false); 10555AutoResizeColumnHeadersHeight(dataGridViewColumn.Index, fixedRowHeadersWidth: true, fixedColumnWidth); 10563dataGridViewColumn.Index, 10571dataGridViewColumn.Index, 10600Debug.Assert(dataGridViewRowDebug.Index != -1 || !dataGridViewCell.HasValue); 10719OnAddedRow_PreNotification(dataGridViewRow.Index); 10727OnAddedRow_PostNotification(dataGridViewRow.Index); 11189dataGridViewColumn.Index, 11213AutoResizeColumnHeadersHeight(dataGridViewColumn.Index, fixedRowHeadersWidth: true, fixedColumnWidth: true); 11220dataGridViewColumn.Index, 11246DataGridViewAutoSizeColumnMode previousInheritedMode = previousModes[dataGridViewColumn.Index]; 11268dataGridViewColumn.Index, 11306dataGridViewColumn.Index, 12095hti._col = dataGridViewLastVisibleColumn.Index; 13335InvalidateColumnInternal(e.Column.Index); 13349OnColumnGlobalAutoSize(e.Column.Index); 13497OnColumnGlobalAutoSize(e.Column.Index); 13584OnColumnHeaderGlobalAutoSize(e.Column.Index); 14079InvalidateCellPrivate(dataGridViewColumn.Index, -1); 14086AutoResizeColumnHeadersHeight(dataGridViewColumn.Index, fixedRowHeadersWidth: true, fixedColumnWidth); 14092AutoResizeColumnInternal(dataGridViewColumn.Index, autoSizeColumnCriteriaInternal, fixedHeight); 14097AutoResizeColumnInternal(dataGridViewColumn.Index, autoSizeColumnCriteriaInternal, fixedHeight: true); 14103AutoResizeColumnHeadersHeight(dataGridViewColumn.Index, fixedRowHeadersWidth: true, fixedColumnWidth: true); 14144SelectColumnRange(dataGridViewColumn.Index, hti._col, true); 14151SelectColumnRange(dataGridViewColumn.Index, _trackColumnEdge, false); 14158SelectColumnRange(dataGridViewColumn.Index, hti._col, true); 14165SelectColumnRange(hti._col, dataGridViewColumn.Index, true); 14172SelectColumnRange(_trackColumnEdge, dataGridViewColumn.Index, false); 14179SelectColumnRange(hti._col, dataGridViewColumn.Index, true); 14186SelectColumnRange(dataGridViewColumn.Index, _trackColumnEdge, false); 14189SelectColumnRange(hti._col, dataGridViewColumn.Index, true); 14196SelectColumnRange(_trackColumnEdge, dataGridViewColumn.Index, false); 14199SelectColumnRange(dataGridViewColumn.Index, hti._col, true); 14282AutoResizeColumnHeadersHeight(dataGridViewColumn.Index, fixedRowHeadersWidth: true, fixedColumnWidth); 14288AutoResizeColumnInternal(dataGridViewColumn.Index, autoSizeColumnCriteriaInternal, fixedHeight); 14293AutoResizeColumnInternal(dataGridViewColumn.Index, autoSizeColumnCriteriaInternal, fixedHeight: true); 14299AutoResizeColumnHeadersHeight(dataGridViewColumn.Index, fixedRowHeadersWidth: true, fixedColumnWidth: true); 14321InvalidateColumnInternal(dataGridViewColumn.Index); 14334Debug.Assert(Columns.DisplayInOrder(dataGridViewColumn.Index, DisplayedBandsInfo.FirstDisplayedScrollingCol)); 14398AutoResizeColumnInternal(dataGridViewColumn.Index, (DataGridViewAutoSizeColumnCriteriaInternal)autoSizeColumnMode, fixedHeight: !autoSizeRows); 14412AdjustExpandingRows(dataGridViewColumn.Index, fixedWidth: true); 14422AutoResizeColumnInternal(dataGridViewColumn.Index, (DataGridViewAutoSizeColumnCriteriaInternal)autoSizeColumnMode, fixedHeight: true); 14436&& dataGridViewColumn.Index == _ptCurrentCell.X 14500int leftEdge = GetColumnXFromIndex(e.Column.Index); 14519PositionEditingControl(_ptCurrentCell.X != e.Column.Index, true, false); 14535OnColumnGlobalAutoSize(e.Column.Index); 14662&& dataGridViewRow.DataGridView is not null && dataGridViewRow.Index == -1) 14669OnRowStateChanged(dataGridViewRow.Index == -1 ? index : dataGridViewRow.Index, dgvrsce); 14722else if (dataGridViewColumn.Visible && _ptCurrentCell.X == dataGridViewColumn.Index) 14743if (_ptCurrentCell.X == dataGridViewColumn.Index 14778int rowIndex = ((dataGridViewRow.Index > -1) ? dataGridViewRow.Index : index); 15257DisplayedBandsInfo.CorrectColumnIndexAfterInsertion(dataGridViewColumn.Index, 1); 16870Debug.Assert(dataGridViewColumn.Index >= 0); 16885DisplayedBandsInfo.CorrectRowIndexAfterDeletion(dataGridViewColumn.Index); 17023Debug.Assert(dataGridViewColumn.Index >= 0 && dataGridViewColumn.Index < Columns.Count); 17026int columnIndex = dataGridViewColumn.Index; 17041newX = dataGridViewColumnNext.Index > columnIndex 17042? dataGridViewColumnNext.Index - 1 17043: dataGridViewColumnNext.Index; 17053? dataGridViewColumnPrevious.Index > columnIndex 17054? dataGridViewColumnPrevious.Index - 1 17055: dataGridViewColumnPrevious.Index 17160if (DisplayedBandsInfo.FirstDisplayedScrollingCol == dataGridViewColumn.Index) 17166else if (Columns.DisplayInOrder(DisplayedBandsInfo.FirstDisplayedScrollingCol, dataGridViewColumn.Index)) 17386OnCellCommonChange(columnIndex, dataGridViewRow.Index); 17402if (_ptCurrentCell.X == dataGridViewRow.Index && _ptCurrentCell.Y == columnIndex) 17603OnRowGlobalAutoSize(e.Row.Index); 17641OnRowGlobalAutoSize(e.Row.Index); 17763UpdateRowErrorText(e.Row.Index); 17847OnRowHeaderGlobalAutoSize(e.Row.Index); 18124if (IsInnerCellOutOfBounds(dataGridViewColumn.Index, hti._row)) 18130bool success = ScrollIntoView(dataGridViewColumn.Index, hti._row, false); 18132if (IsInnerCellOutOfBounds(dataGridViewColumn.Index, hti._row)) 18137success = SetCurrentCellAddressCore(dataGridViewColumn.Index, hti._row, !selectRowRange, false, true); 18280UpdateRowHeightInfoPrivate(e.Row.Index, updateToEnd: false, invalidInAdjustFillingColumns: false); 18282OnRowGlobalAutoSize(e.Row.Index); 18640if (dataGridViewRow.Index == -1) 18698if (_ptCurrentCell.X != -1 && dataGridViewRow.Index == _ptCurrentCell.Y && EditingControl is not null) 20011Debug.Assert(dataGridViewRow.Index == -1); 20023Debug.Assert(dataGridViewRow.Index == -1); 20148int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 21071int lastVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 21546int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 22072int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 22087previousVisibleColumnIndex = dataGridViewColumn.Index; 22918int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 23180int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 23451int lastVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 23466nextVisibleColumnIndex = dataGridViewColumn.Index; 24531int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 25562if (column.Selected && (!_selectedBandIndexes.Contains(column.Index))) 25564_selectedBandIndexes.Add(column.Index); 26070DataGridViewElementStates.None)!.Index; 26091DataGridViewElementStates.None)!.Index; 26622_ptAnchorCell.X = dataGridViewColumn.Index; 27176columnIndex = dataGridViewColumn.Index; 27205columnIndex = dataGridViewColumn.Index; 27292columnIndex = dataGridViewColumn.Index; 28488int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 28503nextVisibleColumnIndex = dataGridViewColumn.Index; 28649int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.Index; 28664previousVisibleColumnIndex = dataGridViewColumn.Index; 28678int lastVisibleColumnIndex = dataGridViewColumn.Index; 29244dataGridViewColumn.Index, 29254dataGridViewColumn.Index, 29273dataGridViewColumn.Index, 29283dataGridViewColumn.Index, 29342dataGridViewColumn.Index, 29363dataGridViewColumn.Index, 29404dataGridViewColumn.Index, 29428dataGridViewColumn.Index, 29447dataGridViewColumn.Index, 29487dataGridViewColumn.Index, 29509dataGridViewColumn.Index, 29518dataGridViewColumn.Index, 29541dataGridViewColumn.Index, 29568dataGridViewColumn.Index, 29586dataGridViewColumn.Index, 29616dataGridViewColumn.Index, 29631dataGridViewColumn.Index, 29660dataGridViewColumn.Index, 29669dataGridViewColumn.Index, 29687dataGridViewColumn.Index, 29713dataGridViewColumn.Index, 29735dataGridViewColumn.Index, 29761dataGridViewColumn.Index, 29780dataGridViewColumn.Index,
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (18)
48return ((DataGridViewRow)this).GetContextMenuStrip(Index); 343if (IsRow && Index > -1) 345GetHeightInfo(Index, out _, out int minimumHeight); 413if (Index == -1) 419DataGridView.SetReadOnlyRowCore(Index, value); 423Debug.Assert(Index >= 0); 425DataGridView.SetReadOnlyColumnCore(Index, value); 544if (Index == -1) 551DataGridView.SetSelectedRowCoreInternal(Index, value); 556Debug.Assert(Index >= 0); 559DataGridView.SetSelectedColumnCoreInternal(Index, value); 604if (IsRow && Index > -1) 606GetHeightInfo(Index, out int height, out _); 690DataGridView.NewRowIndex == Index && 723if (!IsRow || Index >= 0 || DataGridView is null) 805if (Index != -1) 826if (Index != -1) 860public 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); 3913if (OwningRow.Index == DataGridView.CurrentCellAddress.Y)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.DataGridViewCellAccessibleObject.cs (13)
157cellBounds = _owner.DataGridView.GetCellDisplayRectangle(_owner.OwningColumn.Index, _owner.OwningRow.Index, cutOverflow: false); 161cellBounds = _owner.DataGridView.GetCellDisplayRectangle(-1, _owner.OwningRow.Index, cutOverflow: false); 165cellBounds = _owner.DataGridView.GetCellDisplayRectangle(_owner.OwningColumn.Index, -1, cutOverflow: false); 241_owner.OwningRow.Index, 466if (_owner.OwningRow.Index == _owner.DataGridView.Rows.GetFirstRow(DataGridViewElementStates.Visible)) 474int previousVisibleRow = _owner.DataGridView.Rows.GetPreviousRow(_owner.OwningRow.Index, DataGridViewElementStates.Visible); 475return _owner.DataGridView.Rows[previousVisibleRow].Cells[_owner.OwningColumn.Index].AccessibilityObject; 479if (_owner.OwningRow.Index == _owner.DataGridView.Rows.GetLastRow(DataGridViewElementStates.Visible)) 485int nextVisibleRow = _owner.DataGridView.Rows.GetNextRow(_owner.OwningRow.Index, DataGridViewElementStates.Visible); 486return _owner.DataGridView.Rows[nextVisibleRow].Cells[_owner.OwningColumn.Index].AccessibilityObject; 526DataGridViewElementStates.None)!.Index; 559DataGridViewElementStates.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)
912Debug.Assert(dataGridView is null || Index > -1); 958preferredCellThickness = dataGridViewRow.Cells[Index].GetPreferredWidth(rowIndex, dataGridViewRow.Thickness); 962preferredCellThickness = dataGridViewRow.Cells[Index].GetPreferredSize(rowIndex).Width; 982preferredCellThickness = dataGridViewRow.Cells[Index].GetPreferredWidth(rowIndex, dataGridViewRow.Thickness); 986preferredCellThickness = dataGridViewRow.Cells[Index].GetPreferredSize(rowIndex).Width; 1007preferredCellThickness = dataGridViewRow.Cells[Index].GetPreferredWidth(rowIndex, dataGridViewRow.Thickness); 1011preferredCellThickness = dataGridViewRow.Cells[Index].GetPreferredSize(rowIndex).Width; 1029$"DataGridViewColumn {{ Name={Name}, Index={Index} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.cs (10)
122return dataGridViewColumn?.Index ?? -1; 319while (dataGridViewColumn is not null && dataGridViewColumn.Index != columnIndex) 518if (dataGridViewColumn.Index == _itemsSorted[index].Index) 751dataGridViewColumn.Index > dataGridViewColumnStart.Index))) 755dataGridViewColumn.Index < indexMin)) 824dataGridViewColumn.Index < dataGridViewColumnStart.Index))) 828dataGridViewColumn.Index > indexMax))
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnEventArgs.cs (1)
12Debug.Assert(dataGridViewColumn.Index >= -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (3)
1748bool isFirstDisplayedColumn = OwningColumn.Index == DataGridView.FirstDisplayedColumnIndex; 1749bool isFirstDisplayedScrollingColumn = OwningColumn.Index == DataGridView.FirstDisplayedScrollingColumnIndex; 1760Rectangle cellBounds = DataGridView.GetCellDisplayRectangle(OwningColumn.Index, rowIndex, cutOverflow: false);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxColumn.cs (19)
57if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 120if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 126DataGridView.OnColumnCommonChange(Index); 166if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 172DataGridView.OnColumnCommonChange(Index); 209if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 216DataGridView.InvalidateColumn(Index); 253if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 260DataGridView.InvalidateColumn(Index); 297if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 338if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 344DataGridView.OnColumnCommonChange(Index); 401if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 407DataGridView.OnColumnCommonChange(Index); 444if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 485if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 528if (dataGridViewRow.Cells[Index] is DataGridViewComboBoxCell dataGridViewCell) 535DataGridView.OnColumnCommonChange(Index); 541$"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) 1169Debug.Assert(Index == -1); 1375if (DataGridView is null || DataGridView.Rows.SharedRow(rowIndex).Index != -1) 1377if (rowIndex != Index) 1520cell = Cells[dataGridViewColumn.Index]; 1544if (Index != -1) 1610cell = Cells[dataGridViewColumn.Index]; 1634if (Index != -1) 1752Debug.Assert(Index == -1); 1783if (Index == -1) 1805if (!cells[columnIndex].SetValueInternal(Index, values[columnIndex])) 1822return $"DataGridViewRow {{ Index={Index} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.DataGridViewRowAccessibleObject.cs (8)
53Rectangle rowRect = _owningDataGridViewRow.DataGridView.RectangleToScreen(_owningDataGridViewRow.DataGridView.GetRowDisplayRectangle(_owningDataGridViewRow.Index, cutOverflow: false)); 197Rectangle rowBounds = _owningDataGridViewRow.DataGridView.GetRowDisplayRectangle(_owningDataGridViewRow.Index, cutOverflow: true); 217if (_owningDataGridViewRow.DataGridView is not null && _owningDataGridViewRow.DataGridView.AllowUserToAddRows && _owningDataGridViewRow.Index == _owningDataGridViewRow.DataGridView.NewRowIndex) 315dataGridView.CurrentCell.RowIndex == _owningDataGridViewRow.Index) 341if (_owningDataGridViewRow.Index != _owningDataGridViewRow.DataGridView.Rows.GetLastRow(DataGridViewElementStates.Visible)) 355if (_owningDataGridViewRow.Index != _owningDataGridViewRow.DataGridView.Rows.GetFirstRow(DataGridViewElementStates.Visible)) 421dataGridView.CurrentCell = _owningDataGridViewRow.Cells[dataGridView.CurrentCell.OwningColumn.Index]; // Do not change old selection 425int 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); 2226if (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 (34)
System\Windows\Forms\DataGridViewCellTests.cs (1)
579Assert.Equal(columnVisible, row.Index != -1);
System\Windows\Forms\DataGridViewColumnCollectionTests.cs (22)
49Assert.Equal(0, column1.Index); 57Assert.Equal(0, column1.Index); 60Assert.Equal(1, column2.Index); 77Assert.Equal(0, column1.Index); 85Assert.Equal(0, column1.Index); 88Assert.Equal(1, column2.Index); 127Assert.Equal(0, column1.Index); 135Assert.Equal(0, column1.Index); 138Assert.Equal(1, column2.Index); 201Assert.Equal(0, column1.Index); 209Assert.Equal(0, column1.Index); 212Assert.Equal(1, column2.Index); 235Assert.Equal(0, column1.Index); 243Assert.Equal(0, column1.Index); 246Assert.Equal(1, column2.Index); 277Assert.Equal(0, column1.Index); 285Assert.Equal(0, column1.Index); 288Assert.Equal(1, column2.Index); 296Assert.Equal(0, column1.Index); 299Assert.Equal(1, column2.Index); 302Assert.Equal(2, column3.Index); 321Assert.Equal(0, column.Index);
System\Windows\Forms\DataGridViewColumnTests.cs (3)
36Assert.Equal(column.Index, column.Index); 83Assert.Equal(-1, column.Index);
System\Windows\Forms\DataGridViewImageColumnTests.cs (1)
280_column.ToString().Should().Be($"DataGridViewImageColumn {{ Name=MyImageColumn, Index={_column.Index} }}");
System\Windows\Forms\DataGridViewLinkColumnTests.cs (6)
59((DataGridViewLinkCell)row.Cells[_column.Index]).ActiveLinkColor.Should().Be(color); 113((DataGridViewLinkCell)row.Cells[_column.Index]).LinkBehavior.Should().Be(behavior); 151((DataGridViewLinkCell)row.Cells[_column.Index]).LinkColor.Should().Be(color); 212((DataGridViewLinkCell)row.Cells[_column.Index]).TrackVisitedState.Should().Be(trackVisitedState); 250((DataGridViewLinkCell)row.Cells[_column.Index]).UseColumnTextForLinkValue.Should().Be(useColumnTextForLinkValue); 288((DataGridViewLinkCell)row.Cells[_column.Index]).VisitedLinkColor.Should().Be(color);
System\Windows\Forms\DataGridViewRowTests.cs (1)
37Assert.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)