9 writes to NewRowIndex
System.Windows.Forms (9)
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (1)
439
_owner.
NewRowIndex
= -1;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (8)
119
NewRowIndex
= Rows.Count - 1;
5421
NewRowIndex
= -1; // No more 'new' row.
5425
NewRowIndex
--;
5447
NewRowIndex
+= insertionCount;
5531
NewRowIndex
= Rows.Count - 1;
10649
NewRowIndex
= rowIndex;
13286
NewRowIndex
= -1;
14645
NewRowIndex
= -1;
95 references to NewRowIndex
System.Windows.Forms (95)
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (11)
412
if (!_dataConnectionState[DATACONNECTIONSTATE_finishedAddNew] && _owner.
NewRowIndex
== e.NewIndex)
596
if (_owner.
NewRowIndex
== -1 || e.NewIndex != _owner.Rows.Count)
719
CurrencyManager.Position == _owner.
NewRowIndex
&& // condition 4.
720
_owner.CurrentCellAddress.Y != _owner.
NewRowIndex
&& // condition 5.
766
Debug.Assert(_owner.
NewRowIndex
!= -1, "the NewRowIndex is -1 only when AllowUserToAddRows is false");
770
if (_owner.CurrentCellAddress.Y != _owner.
NewRowIndex
|| _owner.IsCurrentRowDirty)
829
if (_owner.
NewRowIndex
== CurrencyManager.List.Count)
832
deleteAddNewRow = (rowIndex == _owner.
NewRowIndex
- 1);
837
Debug.Assert(_owner.
NewRowIndex
== CurrencyManager.List.Count - 1);
838
deleteAddNewRow = (rowIndex == _owner.
NewRowIndex
);
1356
if (e.RowIndex != _owner.
NewRowIndex
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (47)
116
Debug.Assert(
NewRowIndex
== -1);
124
DataGridViewRowEventArgs dgvRowEvent = new(Rows[
NewRowIndex
]);
134
NewRowIndex
+ (AppContextSwitches.DataGridViewUIAStartRowCountAtZero ? 0 : 1)));
3315
if (discardNewRow && _ptCurrentCell.Y ==
NewRowIndex
- 1)
3323
if (!IsCurrentRowDirty && _ptCurrentCell.Y ==
NewRowIndex
- 1 && _dataGridViewState1[State1_NewRowCreatedByEditing])
5419
if (
NewRowIndex
== rowIndexDeleted)
5423
else if (
NewRowIndex
!= -1)
5445
if (
NewRowIndex
!= -1)
5509
Debug.Assert(
NewRowIndex
!= -1);
5511
DataGridViewRowCancelEventArgs dgvrce = new(Rows[
NewRowIndex
]);
5519
Debug.Assert(
NewRowIndex
== Rows.Count - 1);
5520
DataGridViewRow dataGridViewRow = Rows[
NewRowIndex
];
5521
Rows.RemoveAtInternal(
NewRowIndex
, force: false);
5527
Debug.Assert(
NewRowIndex
== -1);
5532
Debug.Assert((Rows.GetRowState(
NewRowIndex
) & DataGridViewElementStates.Visible) != 0);
5533
Debug.Assert(_ptCurrentCell.Y ==
NewRowIndex
);
5535
OnDefaultValuesNeeded(new DataGridViewRowEventArgs(Rows[
NewRowIndex
]));
5536
InvalidateRowPrivate(
NewRowIndex
);
10644
if (AllowUserToAddRowsInternal &&
NewRowIndex
== -1)
10852
if (dataGridViewColumn.CellTemplate!.DefaultNewRowValue is not null &&
NewRowIndex
!= -1)
10856
_ = Rows[
NewRowIndex
];
10870
if (rowIndex ==
NewRowIndex
)
10997
if (dataGridViewColumn.CellTemplate!.DefaultNewRowValue is not null &&
NewRowIndex
!= -1)
11001
_ = Rows[
NewRowIndex
];
11022
if (rowIndex ==
NewRowIndex
)
14640
if (IsCurrentCellDirty &&
NewRowIndex
== _ptCurrentCell.Y)
15493
if (dataGridViewColumn.CellTemplate!.DefaultNewRowValue is not null &&
NewRowIndex
!= -1)
15497
_ = Rows[
NewRowIndex
];
15511
if (rowIndex ==
NewRowIndex
)
17325
Debug.Assert(
NewRowIndex
!= -1);
17326
Debug.Assert(
NewRowIndex
== Rows.Count - 1);
17727
if (!validationFailureOccurred && AllowUserToAddRowsInternal &&
NewRowIndex
== rowIndex)
17733
DataGridViewRowEventArgs dgvre = new(Rows[
NewRowIndex
]);
17754
InvalidateRowPrivate(
NewRowIndex
);
18828
if (rowIndex ==
NewRowIndex
)
19145
if (DataSource is not null && _ptCurrentCell.X >= 0 && AllowUserToAddRowsInternal &&
NewRowIndex
== _ptCurrentCell.Y)
19832
if (
NewRowIndex
!= -1)
19834
DataGridViewRow newRow = Rows.SharedRow(
NewRowIndex
);
19840
newRow = Rows[
NewRowIndex
]; // un-share the 'new row'.
19848
dataGridViewCell.SetValueInternal(
NewRowIndex
, dataGridViewCell.DefaultNewRowValue);
20011
if (rowIndex ==
NewRowIndex
|| rowIndex >= Rows.Count)
25398
if (Columns.Count > 0 &&
NewRowIndex
== -1)
25403
else if (
NewRowIndex
!= -1)
25406
Debug.Assert(
NewRowIndex
== Rows.Count - 1);
25407
Rows.RemoveAtInternal(
NewRowIndex
, force: false);
28415
Debug.Assert(rowIndex1 !=
NewRowIndex
);
28416
Debug.Assert(rowIndex2 !=
NewRowIndex
);
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (2)
681
DataGridView.
NewRowIndex
!= -1 &&
682
DataGridView.
NewRowIndex
== Index &&
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (1)
427
DataGridView.
NewRowIndex
!= rowIndex &&
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (2)
1550
&& rowIndex != DataGridView.
NewRowIndex
2428
|| (dataGridView.AllowUserToAddRowsInternal && rowIndex > -1 && rowIndex == dataGridView.
NewRowIndex
&& rowIndex != dataGridView.CurrentCellAddress.Y)
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (1)
161
DataGridView.
NewRowIndex
== RowIndex &&
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (1)
701
DataGridView.
NewRowIndex
!= rowIndex &&
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (3)
74
&& Index != DataGridView.
NewRowIndex
)
248
get => DataGridView is not null && DataGridView.
NewRowIndex
== Index;
1246
rowIndex != DataGridView.
NewRowIndex
)
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.DataGridViewRowAccessibleObject.cs (1)
217
if (_owningDataGridViewRow.DataGridView is not null && _owningDataGridViewRow.DataGridView.AllowUserToAddRows && _owningDataGridViewRow.Index == _owningDataGridViewRow.DataGridView.
NewRowIndex
)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (18)
224
if (DataGridView.
NewRowIndex
!= -1)
227
Debug.Assert(DataGridView.
NewRowIndex
== Count - 1);
368
if (DataGridView.
NewRowIndex
!= -1)
371
Debug.Assert(DataGridView.
NewRowIndex
== Count - 1);
406
if (DataGridView.
NewRowIndex
!= -1)
409
Debug.Assert(DataGridView.
NewRowIndex
== Count - 1);
483
if (DataGridView.
NewRowIndex
!= -1)
486
Debug.Assert(DataGridView.
NewRowIndex
== Count - 1);
548
if (DataGridView.
NewRowIndex
!= -1)
551
Debug.Assert(DataGridView.
NewRowIndex
== Count - 1);
728
if (DataGridView.
NewRowIndex
!= -1)
731
Debug.Assert(DataGridView.
NewRowIndex
== Count - 1);
1422
if (DataGridView.
NewRowIndex
!= -1 && rowIndex == Count)
1467
if (DataGridView.
NewRowIndex
!= -1 && rowIndex == Count)
1499
Debug.Assert(DataGridView.
NewRowIndex
== -1 || rowIndex != Count);
1599
if (DataGridView.
NewRowIndex
!= -1 && indexDestination == Count)
1769
if (DataGridView.
NewRowIndex
!= -1 && rowIndex == Count)
2168
if (DataGridView.
NewRowIndex
== index)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.RowComparer.cs (2)
41
if (_dataGridView.
NewRowIndex
!= -1)
44
if (rowIndex == _dataGridView.
NewRowIndex
)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (6)
785
else if (DataGridView.
NewRowIndex
== rowIndex)
800
else if (DataGridView.
NewRowIndex
== rowIndex)
810
else if (DataGridView.
NewRowIndex
== rowIndex)
941
else if (DataGridView.
NewRowIndex
== rowIndex)
956
else if (DataGridView.
NewRowIndex
== rowIndex)
966
else if (DataGridView.
NewRowIndex
== rowIndex)