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)
1708Debug.Assert(_ptCurrentCell.Y < Rows.Count); 1776Debug.Assert(_ptCurrentCell.Y >= 0 && _ptCurrentCell.Y < Rows.Count); 1849Debug.Assert(_ptCurrentCell.Y < Rows.Count); 2303&& firstDisplayedCell.RowIndex < Rows.Count 2526ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(value, Rows.Count); 3095int rowCount = Rows.Count; 3115int rowCount = Rows.Count; 3171get => Rows.Count; 3181if (value == Rows.Count) 3191else if (value < Rows.Count) 3194while (value < Rows.Count) 3196int currentRowCount = Rows.Count; 3198if (Rows.Count >= currentRowCount) 3215int 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); 3135Debug.Assert((AllowUserToAddRowsInternal && Rows.Count == 1) || (!AllowUserToAddRowsInternal && Rows.Count == 0)); 3137if (Rows.Count > 0) 3485ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexException, Rows.Count); 3494ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexException, Rows.Count); 4151if (rowIndex >= Rows.Count) 4274int indexTmp = Rows.Count; 4774int nRows = Rows.Count; 5223Debug.Assert(anticipatedRowIndex >= 0 && anticipatedRowIndex <= Rows.Count); 5351int rowsCount = Rows.Count; 5377int rowsCount = Rows.Count; 5452Debug.Assert(Rows.Count > 1); 5463Debug.Assert(NewRowIndex == Rows.Count - 1); 5475NewRowIndex = Rows.Count - 1; 5806if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5817if (e.Button == MouseButtons.Left && dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5831if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5878if (e.Button == MouseButtons.Left && dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5886if (e.Button == MouseButtons.Left && dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5894if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5902if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5910if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 6394Debug.Assert(rowIndex < Rows.Count); 6537&& rowIndexTmp < Rows.Count 6609for (rowIndexTmp = 0; rowIndexTmp < Rows.Count; rowIndexTmp++) 6870return cellCount + _selectedBandIndexes.Count * Rows.Count; 6907for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 6945return Rows.Count * Columns.Count; 6954for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 7061ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 7106Debug.Assert(rowIndex >= -1 && rowIndex < Rows.Count); 9026ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 9033Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 9198Debug.Assert(index >= 0 && index < Rows.Count); 9785ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 9852ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 9859Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 9888Debug.Assert(lo < Rows.Count); 9889Debug.Assert(hi < Rows.Count); 10044return columnIndex >= Columns.Count || rowIndex >= Rows.Count || columnIndex == -1 || rowIndex == -1; 10049return rowIndex >= Rows.Count || rowIndex == -1; 10391&& (includeNewRow || !AllowUserToAddRowsInternal || firstDisplayedCellAddress.Y != Rows.Count - 1)) 10592Debug.Assert(rowIndex == Rows.Count - 1); 10788if (Rows.Count > 0) 10807for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 10829for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 10869if (Rows.Count > 0 && dataGridViewColumn.CellType is null) 10936if (Rows.Count > 0) 10959for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 10980for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 11007CorrectRowFrozenState(dataGridViewRow, rowState, Rows.Count); 11076CorrectRowFrozenStates(dataGridViewRows, rowIndexInserted: Rows.Count); 11512ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(e.RowIndex, Rows.Count, "e.RowIndex"); 11735Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 11823Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 12106if (hti._row >= Rows.Count) 13059Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 13105Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 13280if (Columns.Count != 0 && Rows.Count == 0) 15423if (Rows.Count > 0) 15442for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 15463for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 15900if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 15921if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 15932if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 15989if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 16039if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 16051if (rowIndex < Rows.Count) 16163&& _ptMouseEnteredCell.Y >= -1 && _ptMouseEnteredCell.Y < Rows.Count) 16385if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 17113for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 17240Debug.Assert(rowIndexDeleted >= 0 && rowIndexDeleted < Rows.Count); 17242if (rowIndexDeleted >= 0 && rowIndexDeleted < Rows.Count) 17264Debug.Assert(NewRowIndex == Rows.Count - 1); 17265newY = rowIndexNext > -1 && rowIndexNext < Rows.Count - 1 ? rowIndexNext - 1 : rowIndexPrevious; 17538&& Rows.Count == 0 17617if (!e.Handled && e.Button == MouseButtons.Left && e.RowIndex < Rows.Count) 17662if (rowIndex < Rows.Count && columnIndex < Columns.Count) 17703if (calledAddNewOnTheDataConnection && rowIndex > Rows.Count - 1) 17706rowIndex = Math.Min(rowIndex, Rows.Count - 1); 17728Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 18011if (hti._row >= Rows.Count) 18323if (rowIndex < Rows.Count && columnIndex < Columns.Count) 18335Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 18735if (dataGridViewCell is not null && rowIndex < Rows.Count && columnIndex < Columns.Count) 18782Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 19499if (Columns.Count > 0 || Rows.Count > 0) 19949if (rowIndex == NewRowIndex || rowIndex >= Rows.Count) 19962int dataGridRowsCount = Rows.Count; 19964int dataGridViewRowsCount = Rows.Count; // the number of rows in the dataGridView row collection not counting the AddNewRow 20012if (dataGridRowsCount != Rows.Count) 25336Debug.Assert(NewRowIndex == Rows.Count - 1); 25958Debug.Assert(rowIndex < Rows.Count); 26205Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 26206Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= -1 && DisplayedBandsInfo.FirstDisplayedScrollingRow < Rows.Count); 26265Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 26556int rowIndex = 0, maxRowIndex = Rows.Count; 26577int rowIndex = 0, maxRowIndex = Rows.Count; 26661if (index >= Rows.Count) 26663index -= Rows.Count; 26748ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 26784Debug.Assert(rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count); 26912if (rowIndex >= Rows.Count) 26951if (oldCurrentCellX < Columns.Count && oldCurrentCellY < Rows.Count) 26956if (oldCurrentCellY != _ptCurrentCell.Y && RowHeadersVisible && oldCurrentCellY < Rows.Count) 27115if (oldCurrentCellX < Columns.Count && oldCurrentCellY < Rows.Count) 27120if (RowHeadersVisible && oldCurrentCellY < Rows.Count) 27471Debug.Assert(columnIndex >= 0 && rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count); 27507for (int row = rowIndex + 1; row < Rows.Count; row++) 27580Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 27621ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 27651if (Rows.Count > BulkPaintThreshold) 27670for (int row = rowIndex + 1; row < Rows.Count; row++) 28067ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 28863ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 28877ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 28932ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 28943ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexStart, Rows.Count); 28946ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexEnd, Rows.Count); 28976ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 29170&& _ptMouseEnteredCell.Y < Rows.Count) 29197&& _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)