19 writes to Index
System.Windows.Forms (19)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (4)
5199
Columns[columnIndex].
Index
= Columns[columnIndex].Index - 1;
5210
Columns[columnIndex].
Index
= columnIndex;
5360
dataGridViewRow.
Index
--;
5386
dataGridViewRow.
Index
+= insertionCount;
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (1)
728
dataGridViewBand.
Index
= -1;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.cs (3)
164
dataGridViewColumn.
Index
= index;
254
dataGridViewColumn.
Index
= index;
900
dataGridViewColumn.
Index
= columnIndex;
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (1)
1144
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;
477 references to Index
PresentationUI (4)
MS\Internal\Documents\RMPublishingDialog.cs (1)
575
if (row.
Index
> 0)
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (3)
179
if (row.
Index
> 0)
297
FirstDisplayedScrollingRowIndex = row.
Index
;
769
int rowIndex = row.
Index
;
System.Windows.Forms (443)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (5)
922
previousModes[dataGridViewColumn.
Index
] = dataGridViewColumn.InheritedAutoSizeMode;
2376
firstDisplayedColumnIndex = dataGridViewColumn.
Index
;
2385
int firstDisplayedColumnIndexDbg1 = (dataGridViewColumnDbg1 is null) ? -1 : dataGridViewColumnDbg1.
Index
;
2391
firstDisplayedColumnIndexDbg2 = dataGridViewColumnDbg.
Index
;
3593
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)
316
int preferredThickness = dataGridViewRow.Cells[dataGridViewColumn.
Index
].GetPreferredWidth(
572
if (dataGridViewColumnTmp.
Index
!= dataGridViewColumn.
Index
)
607
if (dataGridViewColumnTmp.
Index
!= dataGridViewColumn.
Index
639
if (dataGridViewColumnTmp.
Index
== dataGridViewColumn.
Index
)
658
if (dataGridViewColumnTmp.
Index
!= dataGridViewColumn.
Index
716
if (dataGridViewColumnTmp.
Index
!= dataGridViewColumn.
Index
)
718
if (Columns.DisplayInOrder(dataGridViewColumn.
Index
, dataGridViewColumnTmp.
Index
))
762
if (dataGridViewColumnTmp.
Index
!= dataGridViewColumn.
Index
765
&& Columns.DisplayInOrder(dataGridViewColumn.
Index
, dataGridViewColumnTmp.
Index
))
803
if (dataGridViewColumnTmp.
Index
== dataGridViewColumn.
Index
804
|| Columns.DisplayInOrder(dataGridViewColumnTmp.
Index
, dataGridViewColumn.
Index
))
806
dataGridViewColumnTmp.UsedFillWeight = dataGridViewColumnTmp.
Index
== dataGridViewColumn.
Index
826
if (Columns.DisplayInOrder(dataGridViewColumn.
Index
, dataGridViewColumnTmp.
Index
)
1415
if (!dataGridViewRow.Cells[dataGridViewColumn.
Index
].Selected)
1443
if (!_selectedBandIndexes.Contains(dataGridViewColumn.
Index
))
1450
if (!dataGridViewRow.Cells[dataGridViewColumn.
Index
].Selected)
1488
if (!dataGridViewRow.Cells[dataGridViewColumn.
Index
].Selected)
1668
ret |= AutoResizeColumnInternal(dataGridViewColumn.
Index
, inheritedAutoSizeColumnCriteria, fixedHeight);
3614
if (firstVisibleFrozenColumn.
Index
== dataGridViewColumn.
Index
)
3619
Debug.Assert(Columns.DisplayInOrder(firstVisibleFrozenColumn.
Index
, dataGridViewColumn.
Index
));
3620
return Columns.GetColumnCount(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen, firstVisibleFrozenColumn.
Index
, dataGridViewColumn.
Index
) < DisplayedBandsInfo.NumDisplayedFrozenCols;
3627
if (firstDisplayedScrollingColumnIndex == dataGridViewColumn.
Index
)
3632
if (Columns.DisplayInOrder(firstDisplayedScrollingColumnIndex, dataGridViewColumn.
Index
))
3634
return Columns.GetColumnCount(DataGridViewElementStates.Visible, firstDisplayedScrollingColumnIndex, dataGridViewColumn.
Index
) < DisplayedBandsInfo.NumDisplayedScrollingCols;
3673
previousColumnIndex = dataGridViewColumnPrev.
Index
;
3695
&& (dataGridViewColumnNext is null || _trackColumn != dataGridViewColumnNext.
Index
))
4229
return (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
4263
return dataGridViewColumn.
Index
;
4269
return dataGridViewColumn.
Index
;
4600
firstDisplayedFrozenCol = dataGridViewColumn.
Index
;
4605
lastDisplayedFrozenCol = dataGridViewColumn.
Index
;
4637
firstDisplayedScrollingCol = dataGridViewColumn.
Index
;
4689
firstDisplayedScrollingCol = dataGridViewColumn.
Index
;
4707
firstDisplayedScrollingCol = dataGridViewColumn.
Index
;
4751
DisplayedBandsInfo.LastTotallyDisplayedScrollingCol = dataGridViewColumn.
Index
;
4941
Debug.Assert(dataGridViewColumn.
Index
>= 0);
5090
while (dataGridViewColumnTmp is not null && Columns.DisplayInOrder(dataGridViewColumnTmp.
Index
, dataGridViewColumn.
Index
))
5124
while (dataGridViewColumnTmp is not null && Columns.DisplayInOrder(dataGridViewColumn.
Index
, dataGridViewColumnTmp.
Index
))
5197
for (int columnIndex = dataGridViewColumn.
Index
; columnIndex < Columns.Count; columnIndex++)
5199
Columns[columnIndex].Index = Columns[columnIndex].
Index
- 1;
5200
Debug.Assert(Columns[columnIndex].
Index
== columnIndex);
5208
for (int columnIndex = dataGridViewColumn.
Index
+ insertionCount; columnIndex < Columns.Count; columnIndex++)
5358
if (dataGridViewRow.
Index
>= 0)
5361
Debug.Assert(dataGridViewRow.
Index
== rowIndex);
5384
if (dataGridViewRow.
Index
>= 0)
5387
Debug.Assert(dataGridViewRow.
Index
== rowIndex);
5469
Debug.Assert(dataGridViewRow.
Index
== -1);
5643
rectInsertionBar.X = GetColumnXFromIndex(Columns.GetFirstColumn(DataGridViewElementStates.Visible)!.
Index
);
6339
if (dataGridViewRow.
Index
== -1)
6720
columnIndexTmp = (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
]
7851
if (lColumn is null || Columns.DisplayInOrder(columnIndex, lColumn.
Index
))
7856
if (uColumn is null || Columns.DisplayInOrder(uColumn.
Index
, columnIndex))
7882
if (lColumn is null || Columns.DisplayInOrder(dataGridViewCell.ColumnIndex, lColumn.
Index
))
7887
if (uColumn is null || Columns.DisplayInOrder(uColumn.
Index
, dataGridViewCell.ColumnIndex))
7898
Debug.Assert(lColumn.
Index
== uColumn.
Index
|| Columns.DisplayInOrder(lColumn.
Index
, uColumn.
Index
));
8047
.Cells[dataGridViewColumn.
Index
]
8117
.Cells[dataGridViewColumn.
Index
]
8226
if (dataGridViewColumn.
Index
== columnIndex)
8257
if (dataGridViewColumn.
Index
== columnIndex)
8272
if (dataGridViewColumn.
Index
== DisplayedBandsInfo.FirstDisplayedScrollingCol)
8295
if (dataGridViewColumn.
Index
== DisplayedBandsInfo.FirstDisplayedScrollingCol)
8358
return dataGridViewColumn.
Index
;
8363
return dataGridViewColumn.
Index
;
8400
return dataGridViewColumn.
Index
;
8405
return dataGridViewColumn.
Index
;
8463
if (index == dataGridViewColumn.
Index
)
8501
if (index == dataGridViewColumn.
Index
)
8537
if (index == dataGridViewColumn.
Index
)
8617
firstColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
8700
int firstUnfrozenColumnIndex = Columns.GetFirstColumn(DataGridViewElementStates.Visible, DataGridViewElementStates.Frozen)!.
Index
;
9381
hti._adjacentCol = dataGridViewColumn.
Index
;
9529
hti._adjacentCol = dataGridViewColumn.
Index
;
9558
if (hti._col == dataGridViewColumn.
Index
10464
InvalidateColumnInternal(dataGridViewColumn.
Index
);
10486
InvalidateColumnInternal(dataGridViewColumn.
Index
);
10535
Debug.Assert(dataGridViewColumn.
Index
>= 0);
10542
dataGridViewColumn.DisplayIndexInternal = dataGridViewColumn.
Index
;
10553
AdjustExpandingRows(dataGridViewColumn.
Index
, fixedWidth: false);
10560
AutoResizeColumnHeadersHeight(dataGridViewColumn.
Index
, fixedRowHeadersWidth: true, fixedColumnWidth);
10568
dataGridViewColumn.
Index
,
10576
dataGridViewColumn.
Index
,
10605
Debug.Assert(dataGridViewRowDebug.
Index
!= -1 || !dataGridViewCell.HasValue);
10724
OnAddedRow_PreNotification(dataGridViewRow.
Index
);
10732
OnAddedRow_PostNotification(dataGridViewRow.
Index
);
11192
dataGridViewColumn.
Index
,
11216
AutoResizeColumnHeadersHeight(dataGridViewColumn.
Index
, fixedRowHeadersWidth: true, fixedColumnWidth: true);
11223
dataGridViewColumn.
Index
,
11249
DataGridViewAutoSizeColumnMode previousInheritedMode = previousModes[dataGridViewColumn.
Index
];
11271
dataGridViewColumn.
Index
,
11309
dataGridViewColumn.
Index
,
12091
hti._col = dataGridViewLastVisibleColumn.
Index
;
13327
InvalidateColumnInternal(e.Column.
Index
);
13341
OnColumnGlobalAutoSize(e.Column.
Index
);
13489
OnColumnGlobalAutoSize(e.Column.
Index
);
13576
OnColumnHeaderGlobalAutoSize(e.Column.
Index
);
14071
InvalidateCellPrivate(dataGridViewColumn.
Index
, -1);
14078
AutoResizeColumnHeadersHeight(dataGridViewColumn.
Index
, fixedRowHeadersWidth: true, fixedColumnWidth);
14084
AutoResizeColumnInternal(dataGridViewColumn.
Index
, autoSizeColumnCriteriaInternal, fixedHeight);
14089
AutoResizeColumnInternal(dataGridViewColumn.
Index
, autoSizeColumnCriteriaInternal, fixedHeight: true);
14095
AutoResizeColumnHeadersHeight(dataGridViewColumn.
Index
, fixedRowHeadersWidth: true, fixedColumnWidth: true);
14136
SelectColumnRange(dataGridViewColumn.
Index
, hti._col, true);
14143
SelectColumnRange(dataGridViewColumn.
Index
, _trackColumnEdge, false);
14150
SelectColumnRange(dataGridViewColumn.
Index
, hti._col, true);
14157
SelectColumnRange(hti._col, dataGridViewColumn.
Index
, true);
14164
SelectColumnRange(_trackColumnEdge, dataGridViewColumn.
Index
, false);
14171
SelectColumnRange(hti._col, dataGridViewColumn.
Index
, true);
14178
SelectColumnRange(dataGridViewColumn.
Index
, _trackColumnEdge, false);
14181
SelectColumnRange(hti._col, dataGridViewColumn.
Index
, true);
14188
SelectColumnRange(_trackColumnEdge, dataGridViewColumn.
Index
, false);
14191
SelectColumnRange(dataGridViewColumn.
Index
, hti._col, true);
14274
AutoResizeColumnHeadersHeight(dataGridViewColumn.
Index
, fixedRowHeadersWidth: true, fixedColumnWidth);
14280
AutoResizeColumnInternal(dataGridViewColumn.
Index
, autoSizeColumnCriteriaInternal, fixedHeight);
14285
AutoResizeColumnInternal(dataGridViewColumn.
Index
, autoSizeColumnCriteriaInternal, fixedHeight: true);
14291
AutoResizeColumnHeadersHeight(dataGridViewColumn.
Index
, fixedRowHeadersWidth: true, fixedColumnWidth: true);
14313
InvalidateColumnInternal(dataGridViewColumn.
Index
);
14326
Debug.Assert(Columns.DisplayInOrder(dataGridViewColumn.
Index
, DisplayedBandsInfo.FirstDisplayedScrollingCol));
14390
AutoResizeColumnInternal(dataGridViewColumn.
Index
, (DataGridViewAutoSizeColumnCriteriaInternal)autoSizeColumnMode, fixedHeight: !autoSizeRows);
14404
AdjustExpandingRows(dataGridViewColumn.
Index
, fixedWidth: true);
14414
AutoResizeColumnInternal(dataGridViewColumn.
Index
, (DataGridViewAutoSizeColumnCriteriaInternal)autoSizeColumnMode, fixedHeight: true);
14428
&& dataGridViewColumn.
Index
== _ptCurrentCell.X
14492
int leftEdge = GetColumnXFromIndex(e.Column.
Index
);
14511
PositionEditingControl(_ptCurrentCell.X != e.Column.
Index
, true, false);
14527
OnColumnGlobalAutoSize(e.Column.
Index
);
14653
if (Events[s_rowStateChangedEvent] is DataGridViewRowStateChangedEventHandler eh && dataGridViewRow.DataGridView is not null && dataGridViewRow.
Index
== -1)
14660
OnRowStateChanged(dataGridViewRow.
Index
== -1 ? index : dataGridViewRow.
Index
, dgvrsce);
14713
else if (dataGridViewColumn.Visible && _ptCurrentCell.X == dataGridViewColumn.
Index
)
14734
if (_ptCurrentCell.X == dataGridViewColumn.
Index
14769
int rowIndex = ((dataGridViewRow.
Index
> -1) ? dataGridViewRow.
Index
: index);
15248
DisplayedBandsInfo.CorrectColumnIndexAfterInsertion(dataGridViewColumn.
Index
, 1);
16860
Debug.Assert(dataGridViewColumn.
Index
>= 0);
16875
DisplayedBandsInfo.CorrectRowIndexAfterDeletion(dataGridViewColumn.
Index
);
17013
Debug.Assert(dataGridViewColumn.
Index
>= 0 && dataGridViewColumn.
Index
< Columns.Count);
17016
int columnIndex = dataGridViewColumn.
Index
;
17031
newX = dataGridViewColumnNext.
Index
> columnIndex
17032
? dataGridViewColumnNext.
Index
- 1
17033
: dataGridViewColumnNext.
Index
;
17043
? dataGridViewColumnPrevious.
Index
> columnIndex
17044
? dataGridViewColumnPrevious.
Index
- 1
17045
: dataGridViewColumnPrevious.
Index
17150
if (DisplayedBandsInfo.FirstDisplayedScrollingCol == dataGridViewColumn.
Index
)
17156
else if (Columns.DisplayInOrder(DisplayedBandsInfo.FirstDisplayedScrollingCol, dataGridViewColumn.
Index
))
17376
OnCellCommonChange(columnIndex, dataGridViewRow.
Index
);
17392
if (_ptCurrentCell.X == dataGridViewRow.
Index
&& _ptCurrentCell.Y == columnIndex)
17593
OnRowGlobalAutoSize(e.Row.
Index
);
17631
OnRowGlobalAutoSize(e.Row.
Index
);
17753
UpdateRowErrorText(e.Row.
Index
);
17837
OnRowHeaderGlobalAutoSize(e.Row.
Index
);
18114
if (IsInnerCellOutOfBounds(dataGridViewColumn.
Index
, hti._row))
18120
bool success = ScrollIntoView(dataGridViewColumn.
Index
, hti._row, false);
18122
if (IsInnerCellOutOfBounds(dataGridViewColumn.
Index
, hti._row))
18127
success = SetCurrentCellAddressCore(dataGridViewColumn.
Index
, hti._row, !selectRowRange, false, true);
18270
UpdateRowHeightInfoPrivate(e.Row.
Index
, updateToEnd: false, invalidInAdjustFillingColumns: false);
18272
OnRowGlobalAutoSize(e.Row.
Index
);
18630
if (dataGridViewRow.
Index
== -1)
18688
if (_ptCurrentCell.X != -1 && dataGridViewRow.
Index
== _ptCurrentCell.Y && EditingControl is not null)
20003
Debug.Assert(dataGridViewRow.
Index
== -1);
20015
Debug.Assert(dataGridViewRow.
Index
== -1);
20145
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
21068
int lastVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
21543
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
22069
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
22084
previousVisibleColumnIndex = dataGridViewColumn.
Index
;
22915
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
23174
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
23443
int lastVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
23458
nextVisibleColumnIndex = dataGridViewColumn.
Index
;
24523
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
25554
if (column.Selected && (!_selectedBandIndexes.Contains(column.
Index
)))
25556
_selectedBandIndexes.Add(column.
Index
);
26062
DataGridViewElementStates.None)!.
Index
;
26083
DataGridViewElementStates.None)!.
Index
;
26615
_ptAnchorCell.X = dataGridViewColumn.
Index
;
27168
columnIndex = dataGridViewColumn.
Index
;
27197
columnIndex = dataGridViewColumn.
Index
;
27284
columnIndex = dataGridViewColumn.
Index
;
28480
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
28495
nextVisibleColumnIndex = dataGridViewColumn.
Index
;
28641
int firstVisibleColumnIndex = (dataGridViewColumn is null) ? -1 : dataGridViewColumn.
Index
;
28656
previousVisibleColumnIndex = dataGridViewColumn.
Index
;
28670
int lastVisibleColumnIndex = dataGridViewColumn.
Index
;
29236
dataGridViewColumn.
Index
,
29246
dataGridViewColumn.
Index
,
29265
dataGridViewColumn.
Index
,
29275
dataGridViewColumn.
Index
,
29334
dataGridViewColumn.
Index
,
29355
dataGridViewColumn.
Index
,
29396
dataGridViewColumn.
Index
,
29420
dataGridViewColumn.
Index
,
29439
dataGridViewColumn.
Index
,
29479
dataGridViewColumn.
Index
,
29501
dataGridViewColumn.
Index
,
29510
dataGridViewColumn.
Index
,
29533
dataGridViewColumn.
Index
,
29560
dataGridViewColumn.
Index
,
29578
dataGridViewColumn.
Index
,
29608
dataGridViewColumn.
Index
,
29623
dataGridViewColumn.
Index
,
29652
dataGridViewColumn.
Index
,
29661
dataGridViewColumn.
Index
,
29679
dataGridViewColumn.
Index
,
29705
dataGridViewColumn.
Index
,
29727
dataGridViewColumn.
Index
,
29753
dataGridViewColumn.
Index
,
29772
dataGridViewColumn.
Index
,
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (18)
48
return ((DataGridViewRow)this).GetContextMenuStrip(
Index
);
349
if (IsRow &&
Index
> -1)
351
GetHeightInfo(
Index
, out int height, out int minimumHeight);
419
if (
Index
== -1)
425
DataGridView.SetReadOnlyRowCore(
Index
, value);
429
Debug.Assert(
Index
>= 0);
431
DataGridView.SetReadOnlyColumnCore(
Index
, value);
550
if (
Index
== -1)
557
DataGridView.SetSelectedRowCoreInternal(
Index
, value);
562
Debug.Assert(
Index
>= 0);
565
DataGridView.SetSelectedColumnCoreInternal(
Index
, value);
610
if (IsRow &&
Index
> -1)
612
GetHeightInfo(
Index
, out int height, out int minimumHeight);
696
DataGridView.NewRowIndex ==
Index
&&
729
if (!IsRow ||
Index
>= 0 || DataGridView is null)
811
if (
Index
!= -1)
832
if (
Index
!= -1)
866
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);
3909
if (OwningRow.
Index
== DataGridView.CurrentCellAddress.Y)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.DataGridViewCellAccessibleObject.cs (13)
158
cellBounds = _owner.DataGridView.GetCellDisplayRectangle(_owner.OwningColumn.
Index
, _owner.OwningRow.
Index
, cutOverflow: false);
162
cellBounds = _owner.DataGridView.GetCellDisplayRectangle(-1, _owner.OwningRow.
Index
, cutOverflow: false);
166
cellBounds = _owner.DataGridView.GetCellDisplayRectangle(_owner.OwningColumn.
Index
, -1, cutOverflow: false);
242
_owner.OwningRow.
Index
,
467
if (_owner.OwningRow.
Index
== _owner.DataGridView.Rows.GetFirstRow(DataGridViewElementStates.Visible))
475
int previousVisibleRow = _owner.DataGridView.Rows.GetPreviousRow(_owner.OwningRow.
Index
, DataGridViewElementStates.Visible);
476
return _owner.DataGridView.Rows[previousVisibleRow].Cells[_owner.OwningColumn.
Index
].AccessibilityObject;
480
if (_owner.OwningRow.
Index
== _owner.DataGridView.Rows.GetLastRow(DataGridViewElementStates.Visible))
486
int nextVisibleRow = _owner.DataGridView.Rows.GetNextRow(_owner.OwningRow.
Index
, DataGridViewElementStates.Visible);
487
return _owner.DataGridView.Rows[nextVisibleRow].Cells[_owner.OwningColumn.
Index
].AccessibilityObject;
527
DataGridViewElementStates.None)!.
Index
;
560
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)
910
Debug.Assert(dataGridView is null ||
Index
> -1);
956
preferredCellThickness = dataGridViewRow.Cells[
Index
].GetPreferredWidth(rowIndex, dataGridViewRow.Thickness);
960
preferredCellThickness = dataGridViewRow.Cells[
Index
].GetPreferredSize(rowIndex).Width;
980
preferredCellThickness = dataGridViewRow.Cells[
Index
].GetPreferredWidth(rowIndex, dataGridViewRow.Thickness);
984
preferredCellThickness = dataGridViewRow.Cells[
Index
].GetPreferredSize(rowIndex).Width;
1005
preferredCellThickness = dataGridViewRow.Cells[
Index
].GetPreferredWidth(rowIndex, dataGridViewRow.Thickness);
1009
preferredCellThickness = dataGridViewRow.Cells[
Index
].GetPreferredSize(rowIndex).Width;
1027
$"DataGridViewColumn {{ Name={Name}, Index={
Index
} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.cs (10)
123
return dataGridViewColumn?.
Index
?? -1;
320
while (dataGridViewColumn is not null && dataGridViewColumn.
Index
!= columnIndex)
519
if (dataGridViewColumn.
Index
== _itemsSorted[index].
Index
)
752
dataGridViewColumn.
Index
> dataGridViewColumnStart.
Index
)))
756
dataGridViewColumn.
Index
< indexMin))
825
dataGridViewColumn.
Index
< dataGridViewColumnStart.
Index
)))
829
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)
1755
bool isFirstDisplayedColumn = OwningColumn.
Index
== DataGridView.FirstDisplayedColumnIndex;
1756
bool isFirstDisplayedScrollingColumn = OwningColumn.
Index
== DataGridView.FirstDisplayedScrollingColumnIndex;
1767
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)
123
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
129
DataGridView.OnColumnCommonChange(
Index
);
169
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
175
DataGridView.OnColumnCommonChange(
Index
);
212
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
219
DataGridView.InvalidateColumn(
Index
);
256
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
263
DataGridView.InvalidateColumn(
Index
);
300
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
341
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
347
DataGridView.OnColumnCommonChange(
Index
);
404
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
410
DataGridView.OnColumnCommonChange(
Index
);
447
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
488
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
531
if (dataGridViewRow.Cells[
Index
] is DataGridViewComboBoxCell dataGridViewCell)
538
DataGridView.OnColumnCommonChange(
Index
);
544
$"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)
1165
Debug.Assert(
Index
== -1);
1371
if (DataGridView is null || DataGridView.Rows.SharedRow(rowIndex).
Index
!= -1)
1373
if (rowIndex !=
Index
)
1517
cell = Cells[dataGridViewColumn.
Index
];
1541
if (
Index
!= -1)
1607
cell = Cells[dataGridViewColumn.
Index
];
1631
if (
Index
!= -1)
1749
Debug.Assert(
Index
== -1);
1780
if (
Index
== -1)
1802
if (!cells[columnIndex].SetValueInternal(
Index
, values[columnIndex]))
1819
return $"DataGridViewRow {{ Index={
Index
} }}";
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.DataGridViewRowAccessibleObject.cs (8)
54
Rectangle rowRect = _owningDataGridViewRow.DataGridView.RectangleToScreen(_owningDataGridViewRow.DataGridView.GetRowDisplayRectangle(_owningDataGridViewRow.
Index
, cutOverflow: false));
198
Rectangle rowBounds = _owningDataGridViewRow.DataGridView.GetRowDisplayRectangle(_owningDataGridViewRow.
Index
, cutOverflow: true);
218
if (_owningDataGridViewRow.DataGridView is not null && _owningDataGridViewRow.DataGridView.AllowUserToAddRows && _owningDataGridViewRow.
Index
== _owningDataGridViewRow.DataGridView.NewRowIndex)
316
dataGridView.CurrentCell.RowIndex == _owningDataGridViewRow.
Index
)
342
if (_owningDataGridViewRow.
Index
!= _owningDataGridViewRow.DataGridView.Rows.GetLastRow(DataGridViewElementStates.Visible))
356
if (_owningDataGridViewRow.
Index
!= _owningDataGridViewRow.DataGridView.Rows.GetFirstRow(DataGridViewElementStates.Visible))
422
dataGridView.CurrentCell = _owningDataGridViewRow.Cells[dataGridView.CurrentCell.OwningColumn.
Index
]; // Do not change old selection
426
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
);
2227
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 (27)
System\Windows\Forms\DataGridViewCellTests.cs (1)
577
Assert.Equal(columnVisible, row.
Index
!= -1);
System\Windows\Forms\DataGridViewColumnCollectionTests.cs (22)
47
Assert.Equal(0, column1.
Index
);
55
Assert.Equal(0, column1.
Index
);
58
Assert.Equal(1, column2.
Index
);
75
Assert.Equal(0, column1.
Index
);
83
Assert.Equal(0, column1.
Index
);
86
Assert.Equal(1, column2.
Index
);
125
Assert.Equal(0, column1.
Index
);
133
Assert.Equal(0, column1.
Index
);
136
Assert.Equal(1, column2.
Index
);
199
Assert.Equal(0, column1.
Index
);
207
Assert.Equal(0, column1.
Index
);
210
Assert.Equal(1, column2.
Index
);
233
Assert.Equal(0, column1.
Index
);
241
Assert.Equal(0, column1.
Index
);
244
Assert.Equal(1, column2.
Index
);
275
Assert.Equal(0, column1.
Index
);
283
Assert.Equal(0, column1.
Index
);
286
Assert.Equal(1, column2.
Index
);
294
Assert.Equal(0, column1.
Index
);
297
Assert.Equal(1, column2.
Index
);
300
Assert.Equal(2, column3.
Index
);
319
Assert.Equal(0, column.
Index
);
System\Windows\Forms\DataGridViewColumnTests.cs (3)
34
Assert.Equal(column.
Index
, column.
Index
);
81
Assert.Equal(-1, column.
Index
);
System\Windows\Forms\DataGridViewRowTests.cs (1)
35
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)