274 references to Count
PresentationUI (2)
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (2)
496if ((e != null) && (e.RowIndex > 0) && (e.RowIndex < Rows.Count) && 620for (int rowIndex = _firstNonOwnerRow; rowIndex < Rows.Count; rowIndex++)
System.Windows.Forms (258)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (14)
1708Debug.Assert(_ptCurrentCell.Y < Rows.Count); 1776Debug.Assert(_ptCurrentCell.Y >= 0 && _ptCurrentCell.Y < Rows.Count); 1849Debug.Assert(_ptCurrentCell.Y < Rows.Count); 2302&& firstDisplayedCell.RowIndex < Rows.Count 2525ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(value, Rows.Count); 3096int rowCount = Rows.Count; 3116int rowCount = Rows.Count; 3172get => Rows.Count; 3182if (value == Rows.Count) 3192else if (value < Rows.Count) 3195while (value < Rows.Count) 3197int currentRowCount = Rows.Count; 3199if (Rows.Count >= currentRowCount) 3216int rowsToAdd = value - Rows.Count;
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (10)
339int dataGridViewRowsCount = _owner.Rows.Count; 494&& CurrencyManager.List.Count == (_owner.AllowUserToAddRowsInternal ? _owner.Rows.Count - 1 : _owner.Rows.Count)) 596if (_owner.NewRowIndex == -1 || e.NewIndex != _owner.Rows.Count) 663if (_owner.Rows.Count > 0 689if (_owner.Rows.Count == (_owner.AllowUserToAddRowsInternal ? 1 : 0)) 763int result = _owner.Rows.Count; 764if (_owner.AllowUserToAddRowsInternal && _owner.Rows.Count > 0) 1244else if (rowIndex < _owner.Rows.Count) 1269&& rowIndex < _owner.Rows.Count
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (135)
28if (cellAddress.Y < 0 || cellAddress.Y >= Rows.Count) 75NewRowIndex = Rows.Count - 1; 325Debug.Assert(rowIndex < Rows.Count); 390Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 1414if (Columns.Count == 0 && Rows.Count == 0) 1432allCellsSelected = _individualSelectedCells.Count == Columns.Count * Rows.Count; 1466allCellsSelected = _selectedBandIndexes.Count * Rows.Count + _individualSelectedCells.Count == Columns.Count * Rows.Count; 1502allCellsSelected = _selectedBandIndexes.Count * Columns.Count + _individualSelectedCells.Count == Columns.Count * Rows.Count; 2006ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 2206ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 2378Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 2692Debug.Assert(_ptCurrentCell.Y >= 0 && _ptCurrentCell.Y < Rows.Count); 3259Debug.Assert((AllowUserToAddRowsInternal && Rows.Count == 1) || (!AllowUserToAddRowsInternal && Rows.Count == 0)); 3261if (Rows.Count > 0) 3611ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexException, Rows.Count); 3620ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexException, Rows.Count); 4277if (rowIndex >= Rows.Count) 4400int indexTmp = Rows.Count; 4905int nRows = Rows.Count; 5378Debug.Assert(anticipatedRowIndex >= 0 && anticipatedRowIndex <= Rows.Count); 5506int rowsCount = Rows.Count; 5532int rowsCount = Rows.Count; 5607Debug.Assert(Rows.Count > 1); 5618Debug.Assert(NewRowIndex == Rows.Count - 1); 5630NewRowIndex = Rows.Count - 1; 5974if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5985if (e.Button == MouseButtons.Left && dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5999if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 6046if (e.Button == MouseButtons.Left && dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 6054if (e.Button == MouseButtons.Left && dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 6062if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 6070if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 6078if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 6570Debug.Assert(rowIndex < Rows.Count); 6723&& rowIndexTmp < Rows.Count 6795for (rowIndexTmp = 0; rowIndexTmp < Rows.Count; rowIndexTmp++) 7056return cellCount + _selectedBandIndexes.Count * Rows.Count; 7093for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 7131return Rows.Count * Columns.Count; 7140for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 7256ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 7310Debug.Assert(rowIndex >= -1 && rowIndex < Rows.Count); 9325ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 9332Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 9505Debug.Assert(index >= 0 && index < Rows.Count); 10199ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 10266ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 10273Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 10302Debug.Assert(lo < Rows.Count); 10303Debug.Assert(hi < Rows.Count); 10458return columnIndex >= Columns.Count || rowIndex >= Rows.Count || columnIndex == -1 || rowIndex == -1; 10463return rowIndex >= Rows.Count || rowIndex == -1; 10812&& (includeNewRow || !AllowUserToAddRowsInternal || firstDisplayedCellAddress.Y != Rows.Count - 1)) 11013Debug.Assert(rowIndex == Rows.Count - 1); 11209if (Rows.Count > 0) 11227for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 11249for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 11289if (Rows.Count > 0 && dataGridViewColumn.CellType is null) 11356if (Rows.Count > 0) 11378for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 11399for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 11426CorrectRowFrozenState(dataGridViewRow, rowState, Rows.Count); 11495CorrectRowFrozenStates(dataGridViewRows, rowIndexInserted: Rows.Count); 11931ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(e.RowIndex, Rows.Count, "e.RowIndex"); 12150Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 12238Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 12518if (hti._row >= Rows.Count) 13467Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 13513Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 13688if (Columns.Count != 0 && Rows.Count == 0) 15830if (Rows.Count > 0) 15848for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 15869for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 16303if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 16324if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 16335if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 16392if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 16442if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 16454if (rowIndex < Rows.Count) 16566&& _ptMouseEnteredCell.Y >= -1 && _ptMouseEnteredCell.Y < Rows.Count) 16788if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 17532for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 17659Debug.Assert(rowIndexDeleted >= 0 && rowIndexDeleted < Rows.Count); 17661if (rowIndexDeleted >= 0 && rowIndexDeleted < Rows.Count) 17683Debug.Assert(NewRowIndex == Rows.Count - 1); 17684if (rowIndexNext > -1 && rowIndexNext < Rows.Count - 1) 17971&& Rows.Count == 0 18050if (!e.Handled && e.Button == MouseButtons.Left && e.RowIndex < Rows.Count) 18095if (rowIndex < Rows.Count && columnIndex < Columns.Count) 18136if (calledAddNewOnTheDataConnection && rowIndex > Rows.Count - 1) 18139rowIndex = Math.Min(rowIndex, Rows.Count - 1); 18161Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 18444if (hti._row >= Rows.Count) 18756if (rowIndex < Rows.Count && columnIndex < Columns.Count) 18768Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 19168if (dataGridViewCell is not null && rowIndex < Rows.Count && columnIndex < Columns.Count) 19215Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 19943if (Columns.Count > 0 || Rows.Count > 0) 20396if (rowIndex == NewRowIndex || rowIndex >= Rows.Count) 20409int dataGridRowsCount = Rows.Count; 20411int dataGridViewRowsCount = Rows.Count; // the number of rows in the dataGridView row collection not counting the AddNewRow 20459if (dataGridRowsCount != Rows.Count) 25810Debug.Assert(NewRowIndex == Rows.Count - 1); 26437Debug.Assert(rowIndex < Rows.Count); 26684Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 26685Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= -1 && DisplayedBandsInfo.FirstDisplayedScrollingRow < Rows.Count); 26744Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 27036int rowIndex = 0, maxRowIndex = Rows.Count; 27057int rowIndex = 0, maxRowIndex = Rows.Count; 27141if (index >= Rows.Count) 27143index -= Rows.Count; 27228ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 27264Debug.Assert(rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count); 27392if (rowIndex >= Rows.Count) 27431if (oldCurrentCellX < Columns.Count && oldCurrentCellY < Rows.Count) 27436if (oldCurrentCellY != _ptCurrentCell.Y && RowHeadersVisible && oldCurrentCellY < Rows.Count) 27594if (oldCurrentCellX < Columns.Count && oldCurrentCellY < Rows.Count) 27599if (RowHeadersVisible && oldCurrentCellY < Rows.Count) 27950Debug.Assert(columnIndex >= 0 && rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count); 27986for (int row = rowIndex + 1; row < Rows.Count; row++) 28059Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 28100ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 28130if (Rows.Count > BulkPaintThreshold) 28149for (int row = rowIndex + 1; row < Rows.Count; row++) 28546ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 29342ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 29356ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 29411ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 29422ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexStart, Rows.Count); 29425ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexEnd, Rows.Count); 29455ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 29657&& _ptMouseEnteredCell.Y < Rows.Count) 29684&& _ptMouseEnteredCell.Y < Rows.Count)
System\Windows\Forms\Controls\DataGridView\DataGridView.TopRowAccessibleObject.cs (1)
208return _ownerDataGridView.Rows.Count == 0 ? null : Parent.GetChild(1);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (1)
493rowIndex < DataGridView.Rows.Count)
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonColumn.cs (3)
83int rowCount = dataGridViewRows.Count; 126int rowCount = dataGridViewRows.Count; 171int rowCount = dataGridViewRows.Count;
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (7)
325if (i < 0 || i >= DataGridView.Rows.Count - 1) 1320ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1742ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1812ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1892ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 2430ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, dataGridView.Rows.Count); 3057if (e.ColumnIndex < DataGridView.Columns.Count && e.RowIndex < DataGridView.Rows.Count)
System\Windows\Forms\Controls\DataGridView\DataGridViewCellPaintingEventArgs.cs (3)
80if (RowIndex < -1 || RowIndex >= _dataGridView.Rows.Count) 109if (RowIndex < -1 || RowIndex >= _dataGridView.Rows.Count) 144if (RowIndex < -1 || RowIndex >= _dataGridView.Rows.Count)
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (2)
834rowIndex < DataGridView.Rows.Count) 972Debug.Assert((rowIndex >= 0) && (rowIndex < DataGridView.Rows.Count));
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxColumn.cs (5)
87int rowCount = dataGridViewRows.Count; 130int rowCount = dataGridViewRows.Count; 174int rowCount = dataGridViewRows.Count; 214int rowCount = dataGridViewRows.Count; 268int rowCount = dataGridViewRows.Count;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxColumn.cs (11)
53int rowCount = dataGridViewRows.Count; 119int rowCount = dataGridViewRows.Count; 165int rowCount = dataGridViewRows.Count; 208int rowCount = dataGridViewRows.Count; 252int rowCount = dataGridViewRows.Count; 296int rowCount = dataGridViewRows.Count; 337int rowCount = dataGridViewRows.Count; 400int rowCount = dataGridViewRows.Count; 443int rowCount = dataGridViewRows.Count; 484int rowCount = dataGridViewRows.Count; 526int rowCount = dataGridViewRows.Count;
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (2)
248(DataGridView is not null && (rowIndex < 0 || rowIndex >= DataGridView.Rows.Count))) 377ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count);
System\Windows\Forms\Controls\DataGridView\DataGridViewImageColumn.cs (3)
94int rowCount = dataGridViewRows.Count; 168int rowCount = dataGridViewRows.Count; 208int rowCount = dataGridViewRows.Count;
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (1)
785rowIndex < DataGridView.Rows.Count)
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkColumn.cs (7)
52int rowCount = dataGridViewRows.Count; 121int rowCount = dataGridViewRows.Count; 163int rowCount = dataGridViewRows.Count; 213int rowCount = dataGridViewRows.Count; 258int rowCount = dataGridViewRows.Count; 301int rowCount = dataGridViewRows.Count; 343int rowCount = dataGridViewRows.Count;
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (4)
1217ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1244ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1293ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1374ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (32)
71int ICollection.Count => Count; 100int rowCount = Count; 227Debug.Assert(DataGridView.NewRowIndex == Count - 1); 228int insertionIndex = Count - 1; 371Debug.Assert(DataGridView.NewRowIndex == Count - 1); 372int insertionIndex = Count - 1; 409Debug.Assert(DataGridView.NewRowIndex == Count - 1); 410int insertionIndex = Count - 1; 486Debug.Assert(DataGridView.NewRowIndex == Count - 1); 488int insertionIndex = Count - 1; 493if (indexSource < 0 || indexSource >= Count) 551Debug.Assert(DataGridView.NewRowIndex == Count - 1); 552int insertionIndex = Count - 1; 566if (indexSource < 0 || Count <= indexSource) 731Debug.Assert(DataGridView.NewRowIndex == Count - 1); 732InsertRange(Count - 1, dataGridViewRows); 861for (int i = 0; i < Count; i++) 1206for (int i = 0; i < Count; i++) 1397if (rowIndex < 0 || Count < rowIndex) 1422if (DataGridView.NewRowIndex != -1 && rowIndex == Count) 1455if (rowIndex < 0 || Count < rowIndex) 1467if (DataGridView.NewRowIndex != -1 && rowIndex == Count) 1495Debug.Assert(rowIndex >= 0 && rowIndex <= Count); 1499Debug.Assert(DataGridView.NewRowIndex == -1 || rowIndex != Count); 1584if (indexSource < 0 || Count <= indexSource) 1589if (indexDestination < 0 || Count < indexDestination) 1599if (DataGridView.NewRowIndex != -1 && indexDestination == Count) 1759if (rowIndex < 0 || rowIndex > Count) 1769if (DataGridView.NewRowIndex != -1 && rowIndex == Count) 2163if (index < 0 || index >= Count) 2211Debug.Assert(index >= 0 && index < Count); 2260Debug.Assert(index < Count);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.UnsharingRowEnumerator.cs (3)
29if (_current < _owner.Count - 1) 36_current = _owner.Count; 61if (_current == _owner.Count)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (3)
100ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 297ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 567ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowPostPaintEventArgs.cs (5)
64if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 81if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 99if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 123if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 152if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowPrePaintEventArgs.cs (5)
81if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 98if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 116if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 140if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 169if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count)
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxColumn.cs (1)
64int rowCount = dataGridViewRows.Count;
System.Windows.Forms.Design (2)
System\Windows\Forms\Design\DataGridViewRowCollectionCodeDomSerializer.cs (2)
32if (rowCollection.Count > 0) 34Debug.Assert(rowCollection.Count == 1, " we should have only the add new row");
System.Windows.Forms.Tests (9)
System\Windows\Forms\AccessibleObjects\DataGridViewAccessibleObjectTests.cs (4)
228for (int i = 0; i < dataGridView.Rows.Count; i++) 1311int rowCount = dataGridView.Rows.Count; 1342int rowCount = dataGridView.Rows.Count; 1385int rowCount = dataGridView.Rows.Count;
System\Windows\Forms\DataGridViewTests.cs (4)
2814Assert.Equal(rowsCount + 1, control.Rows.Count); 2854Assert.Equal(rowsCount1 + 1, control.Rows.Count); // + 1 is the new DGV row 2860Assert.Equal(rowsCount2 + 1, control.Rows.Count); // + 1 is the new DGV row 2868Assert.Equal(rowsCount2 + 1, control.Rows.Count); // + 1 is the new DGV row
System\Windows\Forms\DataGridViewTests.Rendering.cs (1)
146for (int i = 0; i < dataGridView.Rows.Count; i++)
WinFormsControlsTest (3)
DataGridViewInVirtualModeTest.cs (3)
123_rowInEdit = dataGridView1.Rows.Count - 1; 130if (e.RowIndex >= _customers.Count && e.RowIndex != dataGridView1.Rows.Count - 1) 163if (_rowInEdit == dataGridView1.Rows.Count - 2 && _rowInEdit == _customers.Count)