274 references to Count
PresentationUI (2)
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (2)
500if ((e != null) && (e.RowIndex > 0) && (e.RowIndex < Rows.Count) && 624for (int rowIndex = _firstNonOwnerRow; rowIndex < Rows.Count; rowIndex++)
System.Windows.Forms (258)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (14)
1714Debug.Assert(_ptCurrentCell.Y < Rows.Count); 1782Debug.Assert(_ptCurrentCell.Y >= 0 && _ptCurrentCell.Y < Rows.Count); 1855Debug.Assert(_ptCurrentCell.Y < Rows.Count); 2309&& firstDisplayedCell.RowIndex < Rows.Count 2532ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(value, Rows.Count); 3101int rowCount = Rows.Count; 3121int rowCount = Rows.Count; 3177get => Rows.Count; 3187if (value == Rows.Count) 3197else if (value < Rows.Count) 3200while (value < Rows.Count) 3202int currentRowCount = Rows.Count; 3204if (Rows.Count >= currentRowCount) 3221int 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)
27if (cellAddress.Y < 0 || cellAddress.Y >= Rows.Count) 74NewRowIndex = Rows.Count - 1; 300Debug.Assert(rowIndex < Rows.Count); 370Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 1380if (Columns.Count == 0 && Rows.Count == 0) 1398allCellsSelected = _individualSelectedCells.Count == Columns.Count * Rows.Count; 1432allCellsSelected = _selectedBandIndexes.Count * Rows.Count + _individualSelectedCells.Count == Columns.Count * Rows.Count; 1468allCellsSelected = _selectedBandIndexes.Count * Columns.Count + _individualSelectedCells.Count == Columns.Count * Rows.Count; 1953ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 2128ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 2276Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 2579Debug.Assert(_ptCurrentCell.Y >= 0 && _ptCurrentCell.Y < Rows.Count); 3132Debug.Assert((AllowUserToAddRowsInternal && Rows.Count == 1) || (!AllowUserToAddRowsInternal && Rows.Count == 0)); 3134if (Rows.Count > 0) 3482ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexException, Rows.Count); 3491ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexException, Rows.Count); 4148if (rowIndex >= Rows.Count) 4271int indexTmp = Rows.Count; 4771int nRows = Rows.Count; 5220Debug.Assert(anticipatedRowIndex >= 0 && anticipatedRowIndex <= Rows.Count); 5348int rowsCount = Rows.Count; 5374int rowsCount = Rows.Count; 5449Debug.Assert(Rows.Count > 1); 5460Debug.Assert(NewRowIndex == Rows.Count - 1); 5472NewRowIndex = Rows.Count - 1; 5803if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5814if (e.Button == MouseButtons.Left && dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5828if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5875if (e.Button == MouseButtons.Left && dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5883if (e.Button == MouseButtons.Left && dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5891if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5899if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5907if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 6391Debug.Assert(rowIndex < Rows.Count); 6534&& rowIndexTmp < Rows.Count 6606for (rowIndexTmp = 0; rowIndexTmp < Rows.Count; rowIndexTmp++) 6867return cellCount + _selectedBandIndexes.Count * Rows.Count; 6904for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 6942return Rows.Count * Columns.Count; 6951for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 7058ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 7103Debug.Assert(rowIndex >= -1 && rowIndex < Rows.Count); 9023ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 9030Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 9195Debug.Assert(index >= 0 && index < Rows.Count); 9782ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 9849ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 9856Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 9885Debug.Assert(lo < Rows.Count); 9886Debug.Assert(hi < Rows.Count); 10041return columnIndex >= Columns.Count || rowIndex >= Rows.Count || columnIndex == -1 || rowIndex == -1; 10046return rowIndex >= Rows.Count || rowIndex == -1; 10388&& (includeNewRow || !AllowUserToAddRowsInternal || firstDisplayedCellAddress.Y != Rows.Count - 1)) 10589Debug.Assert(rowIndex == Rows.Count - 1); 10785if (Rows.Count > 0) 10804for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 10826for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 10866if (Rows.Count > 0 && dataGridViewColumn.CellType is null) 10933if (Rows.Count > 0) 10956for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 10977for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 11004CorrectRowFrozenState(dataGridViewRow, rowState, Rows.Count); 11073CorrectRowFrozenStates(dataGridViewRows, rowIndexInserted: Rows.Count); 11509ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(e.RowIndex, Rows.Count, "e.RowIndex"); 11732Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 11820Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 12103if (hti._row >= Rows.Count) 13056Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 13102Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 13277if (Columns.Count != 0 && Rows.Count == 0) 15420if (Rows.Count > 0) 15439for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 15460for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 15897if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 15918if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 15929if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 15986if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 16036if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 16048if (rowIndex < Rows.Count) 16160&& _ptMouseEnteredCell.Y >= -1 && _ptMouseEnteredCell.Y < Rows.Count) 16382if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 17110for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 17237Debug.Assert(rowIndexDeleted >= 0 && rowIndexDeleted < Rows.Count); 17239if (rowIndexDeleted >= 0 && rowIndexDeleted < Rows.Count) 17261Debug.Assert(NewRowIndex == Rows.Count - 1); 17262newY = rowIndexNext > -1 && rowIndexNext < Rows.Count - 1 ? rowIndexNext - 1 : rowIndexPrevious; 17535&& Rows.Count == 0 17614if (!e.Handled && e.Button == MouseButtons.Left && e.RowIndex < Rows.Count) 17659if (rowIndex < Rows.Count && columnIndex < Columns.Count) 17700if (calledAddNewOnTheDataConnection && rowIndex > Rows.Count - 1) 17703rowIndex = Math.Min(rowIndex, Rows.Count - 1); 17725Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 18008if (hti._row >= Rows.Count) 18320if (rowIndex < Rows.Count && columnIndex < Columns.Count) 18332Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 18732if (dataGridViewCell is not null && rowIndex < Rows.Count && columnIndex < Columns.Count) 18779Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 19496if (Columns.Count > 0 || Rows.Count > 0) 19946if (rowIndex == NewRowIndex || rowIndex >= Rows.Count) 19959int dataGridRowsCount = Rows.Count; 19961int dataGridViewRowsCount = Rows.Count; // the number of rows in the dataGridView row collection not counting the AddNewRow 20009if (dataGridRowsCount != Rows.Count) 25333Debug.Assert(NewRowIndex == Rows.Count - 1); 25955Debug.Assert(rowIndex < Rows.Count); 26202Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 26203Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= -1 && DisplayedBandsInfo.FirstDisplayedScrollingRow < Rows.Count); 26262Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 26553int rowIndex = 0, maxRowIndex = Rows.Count; 26574int rowIndex = 0, maxRowIndex = Rows.Count; 26658if (index >= Rows.Count) 26660index -= Rows.Count; 26745ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 26781Debug.Assert(rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count); 26909if (rowIndex >= Rows.Count) 26948if (oldCurrentCellX < Columns.Count && oldCurrentCellY < Rows.Count) 26953if (oldCurrentCellY != _ptCurrentCell.Y && RowHeadersVisible && oldCurrentCellY < Rows.Count) 27112if (oldCurrentCellX < Columns.Count && oldCurrentCellY < Rows.Count) 27117if (RowHeadersVisible && oldCurrentCellY < Rows.Count) 27468Debug.Assert(columnIndex >= 0 && rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count); 27504for (int row = rowIndex + 1; row < Rows.Count; row++) 27577Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 27618ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 27648if (Rows.Count > BulkPaintThreshold) 27667for (int row = rowIndex + 1; row < Rows.Count; row++) 28064ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 28860ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 28874ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 28929ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 28940ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexStart, Rows.Count); 28943ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexEnd, Rows.Count); 28973ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 29167&& _ptMouseEnteredCell.Y < Rows.Count) 29194&& _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)
483rowIndex < 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)
313if (i < 0 || i >= DataGridView.Rows.Count - 1) 1304ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1728ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1798ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1878ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 2416ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, dataGridView.Rows.Count); 3045if (DataGridView is not null && 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) 972rowIndex < 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; 116int rowCount = dataGridViewRows.Count; 162int rowCount = dataGridViewRows.Count; 205int rowCount = dataGridViewRows.Count; 249int rowCount = dataGridViewRows.Count; 293int rowCount = dataGridViewRows.Count; 334int rowCount = dataGridViewRows.Count; 397int rowCount = dataGridViewRows.Count; 440int rowCount = dataGridViewRows.Count; 481int rowCount = dataGridViewRows.Count; 523int rowCount = dataGridViewRows.Count;
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (2)
234(DataGridView is not null && (rowIndex < 0 || rowIndex >= DataGridView.Rows.Count))) 363ArgumentOutOfRangeException.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)
733rowIndex < 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)
1215ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1242ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1291ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1372ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (32)
70int ICollection.Count => Count; 99int 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)
230for (int i = 0; i < dataGridView.Rows.Count; i++) 1313int rowCount = dataGridView.Rows.Count; 1344int rowCount = dataGridView.Rows.Count; 1387int rowCount = dataGridView.Rows.Count;
System\Windows\Forms\DataGridViewTests.cs (4)
2815Assert.Equal(rowsCount + 1, control.Rows.Count); 2855Assert.Equal(rowsCount1 + 1, control.Rows.Count); // + 1 is the new DGV row 2861Assert.Equal(rowsCount2 + 1, control.Rows.Count); // + 1 is the new DGV row 2869Assert.Equal(rowsCount2 + 1, control.Rows.Count); // + 1 is the new DGV row
System\Windows\Forms\DataGridViewTests.Rendering.cs (1)
148for (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)