21 writes to Index
System.Windows.Forms (19)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (4)
5193
Columns[columnIndex].
Index
= Columns[columnIndex].Index - 1;
5204
Columns[columnIndex].
Index
= columnIndex;
5354
dataGridViewRow.
Index
--;
5380
dataGridViewRow.
Index
+= insertionCount;
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (1)
722
dataGridViewBand.
Index
= -1;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.cs (3)
163
dataGridViewColumn.
Index
= index;
253
dataGridViewColumn.
Index
= index;
899
dataGridViewColumn.
Index
= columnIndex;
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (1)
1148
Index
= -1;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (10)
130
dataGridViewRow.
Index
= index;
138
newDataGridViewRow.
Index
= index;
263
dataGridViewRow.
Index
= index;
452
dataGridViewRow.
Index
= index;
773
dataGridViewRow.
Index
= index;
1553
dataGridViewRow.
Index
= rowIndex;
1824
dataGridViewRow.
Index
= rowIndexInserted;
2390
dataGridViewRow1.
Index
= rowIndex2;
2395
dataGridViewRow2.
Index
= rowIndex1;
2421
SharedRow(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)
566
if (row.
Index
> 0)
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (3)
176
if (row.
Index
> 0)
294
FirstDisplayedScrollingRowIndex = row.
Index
;
773
int rowIndex = row.
Index
;
System.Windows.Forms (443)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (5)
918
previousModes[dataGridViewColumn.
Index
] = dataGridViewColumn.InheritedAutoSizeMode;
2383
firstDisplayedColumnIndex = dataGridViewColumn.
Index
;
2392
int firstDisplayedColumnIndexDbg1 = (dataGridViewColumnDbg1 is null) ? -1 : dataGridViewColumnDbg1.
Index
;
2398
firstDisplayedColumnIndexDbg2 = dataGridViewColumnDbg.
Index
;
3600
if (!ScrollIntoView(dataGridViewColumn.
Index
, firstVisibleRowIndex, false))
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (1)
1224
columnIndex = dataGridViewColumn.
Index
;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (235)
315
int preferredThickness = dataGridViewRow.Cells[dataGridViewColumn.
Index
].GetPreferredWidth(
571
if (dataGridViewColumnTmp.
Index
!= dataGridViewColumn.
Index
)
606
if (dataGridViewColumnTmp.
Index
!= dataGridViewColumn.
Index
638
if (dataGridViewColumnTmp.
Index
== dataGridViewColumn.
Index
)
657
if (dataGridViewColumnTmp.
Index
!= dataGridViewColumn.
Index
715
if (dataGridViewColumnTmp.
Index
!= dataGridViewColumn.
Index
)
717
if (Columns.DisplayInOrder(dataGridViewColumn.
Index
, dataGridViewColumnTmp.
Index
))
761
if (dataGridViewColumnTmp.
Index
!= dataGridViewColumn.
Index
764
&& Columns.DisplayInOrder(dataGridViewColumn.
Index
, dataGridViewColumnTmp.
Index
))
802
if (dataGridViewColumnTmp.
Index
== dataGridViewColumn.
Index
803
|| Columns.DisplayInOrder(dataGridViewColumnTmp.
Index
, dataGridViewColumn.
Index
))
805
dataGridViewColumnTmp.UsedFillWeight = dataGridViewColumnTmp.
Index
== dataGridViewColumn.
Index
825
if (Columns.DisplayInOrder(dataGridViewColumn.
Index
, dataGridViewColumnTmp.
Index
)
1414
if (!dataGridViewRow.Cells[dataGridViewColumn.
Index
].Selected)
1442
if (!_selectedBandIndexes.Contains(dataGridViewColumn.
Index
))
1449
if (!dataGridViewRow.Cells[dataGridViewColumn.
Index
].Selected)
1487
if (!dataGridViewRow.Cells[dataGridViewColumn.
Index
].Selected)
1667
ret |= AutoResizeColumnInternal(dataGridViewColumn.
Index
, inheritedAutoSizeColumnCriteria, fixedHeight);
3608
if (firstVisibleFrozenColumn.
Index
== dataGridViewColumn.
Index
)
3613
Debug.Assert(Columns.DisplayInOrder(firstVisibleFrozenColumn.
Index
, dataGridViewColumn.
Index
));
3614
return Columns.GetColumnCount(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen, firstVisibleFrozenColumn.
Index
, dataGridViewColumn.
Index
) < DisplayedBandsInfo.NumDisplayedFrozenCols;
3621
if (firstDisplayedScrollingColumnIndex == dataGridViewColumn.
Index
)
3626
if (Columns.DisplayInOrder(firstDisplayedScrollingColumnIndex, dataGridViewColumn.
Index
))
3628
return Columns.GetColumnCount(DataGridViewElementStates.Visible, firstDisplayedScrollingColumnIndex, dataGridViewColumn.
Index
) < DisplayedBandsInfo.NumDisplayedScrollingCols;
3667
previousColumnIndex = dataGridViewColumnPrev.
Index
;
3689
&& (dataGridViewColumnNext is null || _trackColumn != dataGridViewColumnNext.
Index
))
4223
return (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
4257
return dataGridViewColumn.
Index
;
4263
return dataGridViewColumn.
Index
;
4594
firstDisplayedFrozenCol = dataGridViewColumn.
Index
;
4599
lastDisplayedFrozenCol = dataGridViewColumn.
Index
;
4631
firstDisplayedScrollingCol = dataGridViewColumn.
Index
;
4683
firstDisplayedScrollingCol = dataGridViewColumn.
Index
;
4701
firstDisplayedScrollingCol = dataGridViewColumn.
Index
;
4745
DisplayedBandsInfo.LastTotallyDisplayedScrollingCol = dataGridViewColumn.
Index
;
4935
Debug.Assert(dataGridViewColumn.
Index
>= 0);
5084
while (dataGridViewColumnTmp is not null && Columns.DisplayInOrder(dataGridViewColumnTmp.
Index
, dataGridViewColumn.
Index
))
5118
while (dataGridViewColumnTmp is not null && Columns.DisplayInOrder(dataGridViewColumn.
Index
, dataGridViewColumnTmp.
Index
))
5191
for (int columnIndex = dataGridViewColumn.
Index
; columnIndex < Columns.Count; columnIndex++)
5193
Columns[columnIndex].Index = Columns[columnIndex].
Index
- 1;
5194
Debug.Assert(Columns[columnIndex].
Index
== columnIndex);
5202
for (int columnIndex = dataGridViewColumn.
Index
+ insertionCount; columnIndex < Columns.Count; columnIndex++)
5352
if (dataGridViewRow.
Index
>= 0)
5355
Debug.Assert(dataGridViewRow.
Index
== rowIndex);
5378
if (dataGridViewRow.
Index
>= 0)
5381
Debug.Assert(dataGridViewRow.
Index
== rowIndex);
5463
Debug.Assert(dataGridViewRow.
Index
== -1);
5637
rectInsertionBar.X = GetColumnXFromIndex(Columns.GetFirstColumn(DataGridViewElementStates.Visible)!.
Index
);
6333
if (dataGridViewRow.
Index
== -1)
6714
columnIndexTmp = (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
]
7846
if (lColumn is null || Columns.DisplayInOrder(columnIndex, lColumn.
Index
))
7851
if (uColumn is null || Columns.DisplayInOrder(uColumn.
Index
, columnIndex))
7877
if (lColumn is null || Columns.DisplayInOrder(dataGridViewCell.ColumnIndex, lColumn.
Index
))
7882
if (uColumn is null || Columns.DisplayInOrder(uColumn.
Index
, dataGridViewCell.ColumnIndex))
7893
Debug.Assert(lColumn.
Index
== uColumn.
Index
|| Columns.DisplayInOrder(lColumn.
Index
, uColumn.
Index
));
8042
.Cells[dataGridViewColumn.
Index
]
8112
.Cells[dataGridViewColumn.
Index
]
8221
if (dataGridViewColumn.
Index
== columnIndex)
8252
if (dataGridViewColumn.
Index
== columnIndex)
8267
if (dataGridViewColumn.
Index
== DisplayedBandsInfo.FirstDisplayedScrollingCol)
8290
if (dataGridViewColumn.
Index
== DisplayedBandsInfo.FirstDisplayedScrollingCol)
8353
return dataGridViewColumn.
Index
;
8358
return dataGridViewColumn.
Index
;
8395
return dataGridViewColumn.
Index
;
8400
return dataGridViewColumn.
Index
;
8458
if (index == dataGridViewColumn.
Index
)
8496
if (index == dataGridViewColumn.
Index
)
8532
if (index == dataGridViewColumn.
Index
)
8612
firstColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
8695
int firstUnfrozenColumnIndex = Columns.GetFirstColumn(DataGridViewElementStates.Visible, DataGridViewElementStates.Frozen)!.
Index
;
9376
hti._adjacentCol = dataGridViewColumn.
Index
;
9524
hti._adjacentCol = dataGridViewColumn.
Index
;
9553
if (hti._col == dataGridViewColumn.
Index
10459
InvalidateColumnInternal(dataGridViewColumn.
Index
);
10481
InvalidateColumnInternal(dataGridViewColumn.
Index
);
10530
Debug.Assert(dataGridViewColumn.
Index
>= 0);
10537
dataGridViewColumn.DisplayIndexInternal = dataGridViewColumn.
Index
;
10548
AdjustExpandingRows(dataGridViewColumn.
Index
, fixedWidth: false);
10555
AutoResizeColumnHeadersHeight(dataGridViewColumn.
Index
, fixedRowHeadersWidth: true, fixedColumnWidth);
10563
dataGridViewColumn.
Index
,
10571
dataGridViewColumn.
Index
,
10600
Debug.Assert(dataGridViewRowDebug.
Index
!= -1 || !dataGridViewCell.HasValue);
10719
OnAddedRow_PreNotification(dataGridViewRow.
Index
);
10727
OnAddedRow_PostNotification(dataGridViewRow.
Index
);
11189
dataGridViewColumn.
Index
,
11213
AutoResizeColumnHeadersHeight(dataGridViewColumn.
Index
, fixedRowHeadersWidth: true, fixedColumnWidth: true);
11220
dataGridViewColumn.
Index
,
11246
DataGridViewAutoSizeColumnMode previousInheritedMode = previousModes[dataGridViewColumn.
Index
];
11268
dataGridViewColumn.
Index
,
11306
dataGridViewColumn.
Index
,
12095
hti._col = dataGridViewLastVisibleColumn.
Index
;
13335
InvalidateColumnInternal(e.Column.
Index
);
13349
OnColumnGlobalAutoSize(e.Column.
Index
);
13497
OnColumnGlobalAutoSize(e.Column.
Index
);
13584
OnColumnHeaderGlobalAutoSize(e.Column.
Index
);
14079
InvalidateCellPrivate(dataGridViewColumn.
Index
, -1);
14086
AutoResizeColumnHeadersHeight(dataGridViewColumn.
Index
, fixedRowHeadersWidth: true, fixedColumnWidth);
14092
AutoResizeColumnInternal(dataGridViewColumn.
Index
, autoSizeColumnCriteriaInternal, fixedHeight);
14097
AutoResizeColumnInternal(dataGridViewColumn.
Index
, autoSizeColumnCriteriaInternal, fixedHeight: true);
14103
AutoResizeColumnHeadersHeight(dataGridViewColumn.
Index
, fixedRowHeadersWidth: true, fixedColumnWidth: true);
14144
SelectColumnRange(dataGridViewColumn.
Index
, hti._col, true);
14151
SelectColumnRange(dataGridViewColumn.
Index
, _trackColumnEdge, false);
14158
SelectColumnRange(dataGridViewColumn.
Index
, hti._col, true);
14165
SelectColumnRange(hti._col, dataGridViewColumn.
Index
, true);
14172
SelectColumnRange(_trackColumnEdge, dataGridViewColumn.
Index
, false);
14179
SelectColumnRange(hti._col, dataGridViewColumn.
Index
, true);
14186
SelectColumnRange(dataGridViewColumn.
Index
, _trackColumnEdge, false);
14189
SelectColumnRange(hti._col, dataGridViewColumn.
Index
, true);
14196
SelectColumnRange(_trackColumnEdge, dataGridViewColumn.
Index
, false);
14199
SelectColumnRange(dataGridViewColumn.
Index
, hti._col, true);
14282
AutoResizeColumnHeadersHeight(dataGridViewColumn.
Index
, fixedRowHeadersWidth: true, fixedColumnWidth);
14288
AutoResizeColumnInternal(dataGridViewColumn.
Index
, autoSizeColumnCriteriaInternal, fixedHeight);
14293
AutoResizeColumnInternal(dataGridViewColumn.
Index
, autoSizeColumnCriteriaInternal, fixedHeight: true);
14299
AutoResizeColumnHeadersHeight(dataGridViewColumn.
Index
, fixedRowHeadersWidth: true, fixedColumnWidth: true);
14321
InvalidateColumnInternal(dataGridViewColumn.
Index
);
14334
Debug.Assert(Columns.DisplayInOrder(dataGridViewColumn.
Index
, DisplayedBandsInfo.FirstDisplayedScrollingCol));
14398
AutoResizeColumnInternal(dataGridViewColumn.
Index
, (DataGridViewAutoSizeColumnCriteriaInternal)autoSizeColumnMode, fixedHeight: !autoSizeRows);
14412
AdjustExpandingRows(dataGridViewColumn.
Index
, fixedWidth: true);
14422
AutoResizeColumnInternal(dataGridViewColumn.
Index
, (DataGridViewAutoSizeColumnCriteriaInternal)autoSizeColumnMode, fixedHeight: true);
14436
&& dataGridViewColumn.
Index
== _ptCurrentCell.X
14500
int leftEdge = GetColumnXFromIndex(e.Column.
Index
);
14519
PositionEditingControl(_ptCurrentCell.X != e.Column.
Index
, true, false);
14535
OnColumnGlobalAutoSize(e.Column.
Index
);
14662
&& dataGridViewRow.DataGridView is not null && dataGridViewRow.
Index
== -1)
14669
OnRowStateChanged(dataGridViewRow.
Index
== -1 ? index : dataGridViewRow.
Index
, dgvrsce);
14722
else if (dataGridViewColumn.Visible && _ptCurrentCell.X == dataGridViewColumn.
Index
)
14743
if (_ptCurrentCell.X == dataGridViewColumn.
Index
14778
int rowIndex = ((dataGridViewRow.
Index
> -1) ? dataGridViewRow.
Index
: index);
15257
DisplayedBandsInfo.CorrectColumnIndexAfterInsertion(dataGridViewColumn.
Index
, 1);
16870
Debug.Assert(dataGridViewColumn.
Index
>= 0);
16885
DisplayedBandsInfo.CorrectRowIndexAfterDeletion(dataGridViewColumn.
Index
);
17023
Debug.Assert(dataGridViewColumn.
Index
>= 0 && dataGridViewColumn.
Index
< Columns.Count);
17026
int columnIndex = dataGridViewColumn.
Index
;
17041
newX = dataGridViewColumnNext.
Index
> columnIndex
17042
? dataGridViewColumnNext.
Index
- 1
17043
: dataGridViewColumnNext.
Index
;
17053
? dataGridViewColumnPrevious.
Index
> columnIndex
17054
? dataGridViewColumnPrevious.
Index
- 1
17055
: dataGridViewColumnPrevious.
Index
17160
if (DisplayedBandsInfo.FirstDisplayedScrollingCol == dataGridViewColumn.
Index
)
17166
else if (Columns.DisplayInOrder(DisplayedBandsInfo.FirstDisplayedScrollingCol, dataGridViewColumn.
Index
))
17386
OnCellCommonChange(columnIndex, dataGridViewRow.
Index
);
17402
if (_ptCurrentCell.X == dataGridViewRow.
Index
&& _ptCurrentCell.Y == columnIndex)
17603
OnRowGlobalAutoSize(e.Row.
Index
);
17641
OnRowGlobalAutoSize(e.Row.
Index
);
17763
UpdateRowErrorText(e.Row.
Index
);
17847
OnRowHeaderGlobalAutoSize(e.Row.
Index
);
18124
if (IsInnerCellOutOfBounds(dataGridViewColumn.
Index
, hti._row))
18130
bool success = ScrollIntoView(dataGridViewColumn.
Index
, hti._row, false);
18132
if (IsInnerCellOutOfBounds(dataGridViewColumn.
Index
, hti._row))
18137
success = SetCurrentCellAddressCore(dataGridViewColumn.
Index
, hti._row, !selectRowRange, false, true);
18280
UpdateRowHeightInfoPrivate(e.Row.
Index
, updateToEnd: false, invalidInAdjustFillingColumns: false);
18282
OnRowGlobalAutoSize(e.Row.
Index
);
18640
if (dataGridViewRow.
Index
== -1)
18698
if (_ptCurrentCell.X != -1 && dataGridViewRow.
Index
== _ptCurrentCell.Y && EditingControl is not null)
20011
Debug.Assert(dataGridViewRow.
Index
== -1);
20023
Debug.Assert(dataGridViewRow.
Index
== -1);
20148
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
21071
int lastVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
21546
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
22072
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
22087
previousVisibleColumnIndex = dataGridViewColumn.
Index
;
22918
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
23180
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
23451
int lastVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
23466
nextVisibleColumnIndex = dataGridViewColumn.
Index
;
24531
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
25562
if (column.Selected && (!_selectedBandIndexes.Contains(column.
Index
)))
25564
_selectedBandIndexes.Add(column.
Index
);
26070
DataGridViewElementStates.None)!.
Index
;
26091
DataGridViewElementStates.None)!.
Index
;
26622
_ptAnchorCell.X = dataGridViewColumn.
Index
;
27176
columnIndex = dataGridViewColumn.
Index
;
27205
columnIndex = dataGridViewColumn.
Index
;
27292
columnIndex = dataGridViewColumn.
Index
;
28488
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
28503
nextVisibleColumnIndex = dataGridViewColumn.
Index
;
28649
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
28664
previousVisibleColumnIndex = dataGridViewColumn.
Index
;
28678
int lastVisibleColumnIndex = dataGridViewColumn.
Index
;
29244
dataGridViewColumn.
Index
,
29254
dataGridViewColumn.
Index
,
29273
dataGridViewColumn.
Index
,
29283
dataGridViewColumn.
Index
,
29342
dataGridViewColumn.
Index
,
29363
dataGridViewColumn.
Index
,
29404
dataGridViewColumn.
Index
,
29428
dataGridViewColumn.
Index
,
29447
dataGridViewColumn.
Index
,
29487
dataGridViewColumn.
Index
,
29509
dataGridViewColumn.
Index
,
29518
dataGridViewColumn.
Index
,
29541
dataGridViewColumn.
Index
,
29568
dataGridViewColumn.
Index
,
29586
dataGridViewColumn.
Index
,
29616
dataGridViewColumn.
Index
,
29631
dataGridViewColumn.
Index
,
29660
dataGridViewColumn.
Index
,
29669
dataGridViewColumn.
Index
,
29687
dataGridViewColumn.
Index
,
29713
dataGridViewColumn.
Index
,
29735
dataGridViewColumn.
Index
,
29761
dataGridViewColumn.
Index
,
29780
dataGridViewColumn.
Index
,
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (18)
48
return ((DataGridViewRow)this).GetContextMenuStrip(
Index
);
343
if (IsRow &&
Index
> -1)
345
GetHeightInfo(
Index
, out _, out int minimumHeight);
413
if (
Index
== -1)
419
DataGridView.SetReadOnlyRowCore(
Index
, value);
423
Debug.Assert(
Index
>= 0);
425
DataGridView.SetReadOnlyColumnCore(
Index
, value);
544
if (
Index
== -1)
551
DataGridView.SetSelectedRowCoreInternal(
Index
, value);
556
Debug.Assert(
Index
>= 0);
559
DataGridView.SetSelectedColumnCoreInternal(
Index
, value);
604
if (IsRow &&
Index
> -1)
606
GetHeightInfo(
Index
, out int height, out _);
690
DataGridView.NewRowIndex ==
Index
&&
723
if (!IsRow ||
Index
>= 0 || DataGridView is null)
805
if (
Index
!= -1)
826
if (
Index
!= -1)
860
public override string ToString() => $"DataGridViewBand {{ Index={
Index
} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonColumn.cs (9)
87
if (dataGridViewRow.Cells[
Index
] is DataGridViewButtonCell dataGridViewCell)
93
DataGridView.OnColumnCommonChange(
Index
);
121
DataGridView.OnColumnCommonChange(
Index
);
130
if (dataGridViewRow.Cells[
Index
] is DataGridViewButtonCell dataGridViewCell && dataGridViewCell.UseColumnTextForButtonValue)
132
DataGridView.OnColumnCommonChange(
Index
);
137
DataGridView.InvalidateColumn(
Index
);
175
if (dataGridViewRow.Cells[
Index
] is DataGridViewButtonCell dataGridViewCell)
181
DataGridView.OnColumnCommonChange(
Index
);
230
$"DataGridViewButtonColumn {{ Name={Name}, Index={
Index
} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (5)
102
public int ColumnIndex => OwningColumn?.
Index
?? -1;
526
public int RowIndex => OwningRow?.
Index
?? -1;
982
bool isLastVisibleColumn = (dataGridViewColumn is not null && dataGridViewColumn.
Index
== ColumnIndex);
1865
Debug.Assert(state == stateDebug || DataGridView.Rows.SharedRow(rowIndex).
Index
== -1);
3913
if (OwningRow.
Index
== DataGridView.CurrentCellAddress.Y)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.DataGridViewCellAccessibleObject.cs (13)
157
cellBounds = _owner.DataGridView.GetCellDisplayRectangle(_owner.OwningColumn.
Index
, _owner.OwningRow.
Index
, cutOverflow: false);
161
cellBounds = _owner.DataGridView.GetCellDisplayRectangle(-1, _owner.OwningRow.
Index
, cutOverflow: false);
165
cellBounds = _owner.DataGridView.GetCellDisplayRectangle(_owner.OwningColumn.
Index
, -1, cutOverflow: false);
241
_owner.OwningRow.
Index
,
466
if (_owner.OwningRow.
Index
== _owner.DataGridView.Rows.GetFirstRow(DataGridViewElementStates.Visible))
474
int previousVisibleRow = _owner.DataGridView.Rows.GetPreviousRow(_owner.OwningRow.
Index
, DataGridViewElementStates.Visible);
475
return _owner.DataGridView.Rows[previousVisibleRow].Cells[_owner.OwningColumn.
Index
].AccessibilityObject;
479
if (_owner.OwningRow.
Index
== _owner.DataGridView.Rows.GetLastRow(DataGridViewElementStates.Visible))
485
int nextVisibleRow = _owner.DataGridView.Rows.GetNextRow(_owner.OwningRow.
Index
, DataGridViewElementStates.Visible);
486
return _owner.DataGridView.Rows[nextVisibleRow].Cells[_owner.OwningColumn.
Index
].AccessibilityObject;
526
DataGridViewElementStates.None)!.
Index
;
559
DataGridViewElementStates.None)!.
Index
;
System\Windows\Forms\Controls\DataGridView\DataGridViewCellCollection.cs (2)
128
return _items[dataGridViewColumn.
Index
];
143
this[dataGridViewColumn.
Index
] = value;
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxColumn.cs (11)
91
if (dataGridViewRow.Cells[
Index
] is DataGridViewCheckBoxCell dataGridViewCell)
97
DataGridView.InvalidateColumn(
Index
);
134
if (dataGridViewRow.Cells[
Index
] is DataGridViewCheckBoxCell dataGridViewCell)
140
DataGridView.OnColumnCommonChange(
Index
);
178
if (dataGridViewRow.Cells[
Index
] is DataGridViewCheckBoxCell dataGridViewCell)
184
DataGridView.InvalidateColumn(
Index
);
218
if (dataGridViewRow.Cells[
Index
] is DataGridViewCheckBoxCell dataGridViewCell)
224
DataGridView.InvalidateColumn(
Index
);
272
if (dataGridViewRow.Cells[
Index
] is DataGridViewCheckBoxCell dataGridViewCell)
278
DataGridView.InvalidateColumn(
Index
);
316
$"DataGridViewCheckBoxColumn {{ Name={Name}, Index={
Index
} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (8)
912
Debug.Assert(dataGridView is null ||
Index
> -1);
958
preferredCellThickness = dataGridViewRow.Cells[
Index
].GetPreferredWidth(rowIndex, dataGridViewRow.Thickness);
962
preferredCellThickness = dataGridViewRow.Cells[
Index
].GetPreferredSize(rowIndex).Width;
982
preferredCellThickness = dataGridViewRow.Cells[
Index
].GetPreferredWidth(rowIndex, dataGridViewRow.Thickness);
986
preferredCellThickness = dataGridViewRow.Cells[
Index
].GetPreferredSize(rowIndex).Width;
1007
preferredCellThickness = dataGridViewRow.Cells[
Index
].GetPreferredWidth(rowIndex, dataGridViewRow.Thickness);
1011
preferredCellThickness = dataGridViewRow.Cells[
Index
].GetPreferredSize(rowIndex).Width;
1029
$"DataGridViewColumn {{ Name={Name}, Index={
Index
} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.cs (10)
122
return dataGridViewColumn?.
Index
?? -1;
319
while (dataGridViewColumn is not null && dataGridViewColumn.
Index
!= columnIndex)
518
if (dataGridViewColumn.
Index
== _itemsSorted[index].
Index
)
751
dataGridViewColumn.
Index
> dataGridViewColumnStart.
Index
)))
755
dataGridViewColumn.
Index
< indexMin))
824
dataGridViewColumn.
Index
< dataGridViewColumnStart.
Index
)))
828
dataGridViewColumn.
Index
> indexMax))
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnEventArgs.cs (1)
12
Debug.Assert(dataGridViewColumn.
Index
>= -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (3)
1748
bool isFirstDisplayedColumn = OwningColumn.
Index
== DataGridView.FirstDisplayedColumnIndex;
1749
bool isFirstDisplayedScrollingColumn = OwningColumn.
Index
== DataGridView.FirstDisplayedScrollingColumnIndex;
1760
Rectangle cellBounds = DataGridView.GetCellDisplayRectangle(OwningColumn.
Index
, rowIndex, cutOverflow: false);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxColumn.cs (19)
57
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
120
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
126
DataGridView.OnColumnCommonChange(
Index
);
166
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
172
DataGridView.OnColumnCommonChange(
Index
);
209
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
216
DataGridView.InvalidateColumn(
Index
);
253
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
260
DataGridView.InvalidateColumn(
Index
);
297
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
338
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
344
DataGridView.OnColumnCommonChange(
Index
);
401
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
407
DataGridView.OnColumnCommonChange(
Index
);
444
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
485
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
528
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
535
DataGridView.OnColumnCommonChange(
Index
);
541
$"DataGridViewComboBoxColumn {{ Name={Name}, Index={
Index
} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (1)
302
if (OwningRow is null || OwningRow.
Index
!= -1)
System\Windows\Forms\Controls\DataGridView\DataGridViewImageColumn.cs (8)
98
if (dataGridViewRow.Cells[
Index
] is DataGridViewImageCell dataGridViewCell)
114
DataGridView?.OnColumnCommonChange(
Index
);
127
DataGridView?.OnColumnCommonChange(
Index
);
172
if (dataGridViewRow.Cells[
Index
] is DataGridViewImageCell dataGridViewCell)
178
DataGridView.OnColumnCommonChange(
Index
);
212
if (dataGridViewRow.Cells[
Index
] is DataGridViewImageCell dataGridViewCell)
218
DataGridView.OnColumnCommonChange(
Index
);
292
$"DataGridViewImageColumn {{ Name={Name}, Index={
Index
} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkColumn.cs (17)
56
if (dataGridViewRow.Cells[
Index
] is DataGridViewLinkCell dataGridViewCell)
62
DataGridView.InvalidateColumn(
Index
);
125
if (dataGridViewRow.Cells[
Index
] is DataGridViewLinkCell dataGridViewCell)
131
DataGridView.InvalidateColumn(
Index
);
167
if (dataGridViewRow.Cells[
Index
] is DataGridViewLinkCell dataGridViewCell)
173
DataGridView.InvalidateColumn(
Index
);
208
DataGridView.OnColumnCommonChange(
Index
);
217
if (dataGridViewRow.Cells[
Index
] is DataGridViewLinkCell dataGridViewCell && dataGridViewCell.UseColumnTextForLinkValue)
219
DataGridView.OnColumnCommonChange(
Index
);
224
DataGridView.InvalidateColumn(
Index
);
262
if (dataGridViewRow.Cells[
Index
] is DataGridViewLinkCell dataGridViewCell)
268
DataGridView.InvalidateColumn(
Index
);
305
if (dataGridViewRow.Cells[
Index
] is DataGridViewLinkCell dataGridViewCell)
311
DataGridView.OnColumnCommonChange(
Index
);
347
if (dataGridViewRow.Cells[
Index
] is DataGridViewLinkCell dataGridViewCell)
353
DataGridView.InvalidateColumn(
Index
);
388
$"DataGridViewLinkColumn {{ Name={Name}, Index={
Index
} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (39)
73
&&
Index
> -1
74
&&
Index
!= DataGridView.NewRowIndex)
76
return DataGridView.DataConnection.CurrencyManager[
Index
];
96
if (DataGridView is not null &&
Index
== -1)
110
if (DataGridView is not null &&
Index
== -1)
115
return GetDisplayed(
Index
);
128
if (DataGridView is not null &&
Index
== -1)
145
Debug.Assert(
Index
>= -1);
146
return GetErrorText(
Index
);
181
if (DataGridView is not null &&
Index
== -1)
186
return GetFrozen(
Index
);
190
if (DataGridView is not null &&
Index
== -1)
218
if (DataGridView is not null &&
Index
== -1)
231
if (
Index
== -1)
237
BuildInheritedRowStyle(
Index
, inheritedRowStyle);
248
get => DataGridView is not null && DataGridView.NewRowIndex ==
Index
;
258
if (DataGridView is not null &&
Index
== -1)
276
if (DataGridView is not null &&
Index
== -1)
281
return GetReadOnly(
Index
);
293
if (DataGridView is not null &&
Index
== -1)
298
return GetResizable(
Index
);
307
if (DataGridView is not null &&
Index
== -1)
312
return GetSelected(
Index
);
321
if (DataGridView is not null &&
Index
== -1)
326
return GetState(
Index
);
335
if (DataGridView is not null &&
Index
== -1)
340
return GetVisible(
Index
);
344
if (DataGridView is not null &&
Index
== -1)
1169
Debug.Assert(
Index
== -1);
1375
if (DataGridView is null || DataGridView.Rows.SharedRow(rowIndex).
Index
!= -1)
1377
if (rowIndex !=
Index
)
1520
cell = Cells[dataGridViewColumn.
Index
];
1544
if (
Index
!= -1)
1610
cell = Cells[dataGridViewColumn.
Index
];
1634
if (
Index
!= -1)
1752
Debug.Assert(
Index
== -1);
1783
if (
Index
== -1)
1805
if (!cells[columnIndex].SetValueInternal(
Index
, values[columnIndex]))
1822
return $"DataGridViewRow {{ Index={
Index
} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.DataGridViewRowAccessibleObject.cs (8)
53
Rectangle rowRect = _owningDataGridViewRow.DataGridView.RectangleToScreen(_owningDataGridViewRow.DataGridView.GetRowDisplayRectangle(_owningDataGridViewRow.
Index
, cutOverflow: false));
197
Rectangle rowBounds = _owningDataGridViewRow.DataGridView.GetRowDisplayRectangle(_owningDataGridViewRow.
Index
, cutOverflow: true);
217
if (_owningDataGridViewRow.DataGridView is not null && _owningDataGridViewRow.DataGridView.AllowUserToAddRows && _owningDataGridViewRow.
Index
== _owningDataGridViewRow.DataGridView.NewRowIndex)
315
dataGridView.CurrentCell.RowIndex == _owningDataGridViewRow.
Index
)
341
if (_owningDataGridViewRow.
Index
!= _owningDataGridViewRow.DataGridView.Rows.GetLastRow(DataGridViewElementStates.Visible))
355
if (_owningDataGridViewRow.
Index
!= _owningDataGridViewRow.DataGridView.Rows.GetFirstRow(DataGridViewElementStates.Visible))
421
dataGridView.CurrentCell = _owningDataGridViewRow.Cells[dataGridView.CurrentCell.OwningColumn.
Index
]; // Do not change old selection
425
int firstVisibleCell = dataGridView.Columns.GetFirstColumn(DataGridViewElementStates.Visible)!.
Index
;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (20)
124
if (dataGridViewRow.
Index
== -1)
500
if (rowTemplate.
Index
== -1 && !IsCollectionChangedListenedTo && !newRow)
585
if (rowTemplate.
Index
== -1)
704
Debug.Assert(dataGridViewRow.
Index
== -1);
1335
if (dataGridViewRow.
Index
== -1)
1341
Debug.Assert(dataGridViewRow.
Index
== rowIndex);
1613
if (rowTemplate.
Index
== -1)
1733
Debug.Assert(dataGridViewRow.
Index
== -1);
1916
originalIndex = SharedRow(rowIndex).
Index
;
1920
if (originalIndex == -1 && SharedRow(rowIndex).
Index
!= -1)
1942
originalIndex = SharedRow(rowIndex).
Index
;
1946
if (originalIndex == -1 && SharedRow(rowIndex).
Index
!= -1)
2151
if (dataGridViewRow.
Index
== -1)
2157
RemoveAt(dataGridViewRow.
Index
);
2226
if (dataGridViewRow.
Index
!= -1)
2243
Debug.Assert(dataGridViewRow.
Index
== -1);
2263
if (dataGridViewRow.
Index
!= -1)
2292
if (dataGridViewRow.
Index
== -1)
2388
if (dataGridViewRow1.
Index
!= -1)
2393
if (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)
155
if (Owner.OwningRow.
Index
== Owner.DataGridView.Rows.GetLastRow(DataGridViewElementStates.Visible))
160
int nextVisibleRow = Owner.DataGridView.Rows.GetNextRow(Owner.OwningRow.
Index
, DataGridViewElementStates.Visible);
174
if (Owner.OwningRow.
Index
== Owner.DataGridView.Rows.GetFirstRow(DataGridViewElementStates.Visible))
187
int previousVisibleRow = Owner.DataGridView.Rows.GetPreviousRow(Owner.OwningRow.
Index
, DataGridViewElementStates.Visible);
System\Windows\Forms\Controls\DataGridView\DataGridViewSortCompareEventArgs.cs (1)
18
Debug.Assert(dataGridViewColumn.
Index
>= 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxColumn.cs (2)
68
if (dataGridViewRow.Cells[
Index
] is DataGridViewTextBoxCell dataGridViewCell)
86
$"DataGridViewTextBoxColumn {{ Name={Name}, Index={
Index
} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.DataGridViewTopLeftHeaderCellAccessibleObject.cs (2)
219
col.
Index
,
220
row.
Index
,
System.Windows.Forms.Tests (34)
System\Windows\Forms\DataGridViewCellTests.cs (1)
579
Assert.Equal(columnVisible, row.
Index
!= -1);
System\Windows\Forms\DataGridViewColumnCollectionTests.cs (22)
49
Assert.Equal(0, column1.
Index
);
57
Assert.Equal(0, column1.
Index
);
60
Assert.Equal(1, column2.
Index
);
77
Assert.Equal(0, column1.
Index
);
85
Assert.Equal(0, column1.
Index
);
88
Assert.Equal(1, column2.
Index
);
127
Assert.Equal(0, column1.
Index
);
135
Assert.Equal(0, column1.
Index
);
138
Assert.Equal(1, column2.
Index
);
201
Assert.Equal(0, column1.
Index
);
209
Assert.Equal(0, column1.
Index
);
212
Assert.Equal(1, column2.
Index
);
235
Assert.Equal(0, column1.
Index
);
243
Assert.Equal(0, column1.
Index
);
246
Assert.Equal(1, column2.
Index
);
277
Assert.Equal(0, column1.
Index
);
285
Assert.Equal(0, column1.
Index
);
288
Assert.Equal(1, column2.
Index
);
296
Assert.Equal(0, column1.
Index
);
299
Assert.Equal(1, column2.
Index
);
302
Assert.Equal(2, column3.
Index
);
321
Assert.Equal(0, column.
Index
);
System\Windows\Forms\DataGridViewColumnTests.cs (3)
36
Assert.Equal(column.
Index
, column.
Index
);
83
Assert.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)
37
Assert.Equal(-1, row.
Index
);
WinFormsControlsTest (3)
DataGridViewInVirtualModeTest.cs (3)
180
if (e.Row.
Index
< _customers.Count)
184
_customers.RemoveAt(e.Row.
Index
);
187
if (e.Row.
Index
== _rowInEdit)