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