214 references to DataGridView
System.Windows.Forms (214)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (213)
13/// <see cref="DataGridView"/> control. 132DataGridView?.OnRowUnshared(dataGridViewRow); 147dataGridViewCell.OwningColumn = DataGridView.Columns[columnIndex]; 157DataGridView?.OnRowUnshared(newDataGridViewRow); 177if (DataGridView.DataSource is not null) 182if (DataGridView.NoDimensionChangeAllowed) 192Debug.Assert(DataGridView is not null); 194if (DataGridView.Columns.Count == 0) 199if (DataGridView.RowTemplate.Cells.Count > DataGridView.Columns.Count) 204DataGridViewRow dataGridViewRow = DataGridView.RowTemplateClone; 205Debug.Assert(dataGridViewRow.Cells.Count == DataGridView.Columns.Count); 224if (DataGridView.NewRowIndex != -1) 226Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 227Debug.Assert(DataGridView.NewRowIndex == Count - 1); 234DataGridView.OnAddingRow(dataGridViewRow, rowState, checkFrozenState: true); // will throw an exception if the addition is illegal 242dataGridViewCell.OwningColumn = DataGridView.Columns[columnIndex]; 248dataGridViewRow.HeaderCell.DataGridView = DataGridView; 257DataGridView._dataStoreAccessAllowed = false; 274Debug.Assert(DataGridView is not null); 277if (DataGridView.VirtualMode) 282if (DataGridView.DataSource is not null) 287if (DataGridView.NoDimensionChangeAllowed) 300if (DataGridView.Columns.Count == 0) 305if (DataGridView.DataSource is not null) 310if (DataGridView.NoDimensionChangeAllowed) 321Debug.Assert(DataGridView is not null); 328if (DataGridView.Columns.Count == 0) 333if (DataGridView.DataSource is not null) 338if (DataGridView.NoDimensionChangeAllowed) 343if (DataGridView.RowTemplate.Cells.Count > DataGridView.Columns.Count) 348DataGridViewRow rowTemplate = DataGridView.RowTemplateClone; 349Debug.Assert(rowTemplate.Cells.Count == DataGridView.Columns.Count); 358dataGridViewCell.OwningColumn = DataGridView.Columns[columnIndex]; 368if (DataGridView.NewRowIndex != -1) 370Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 371Debug.Assert(DataGridView.NewRowIndex == Count - 1); 382Debug.Assert(DataGridView is not null); 391if (DataGridView.Columns.Count == 0) 396if (dataGridViewRow.Cells.Count > DataGridView.Columns.Count) 406if (DataGridView.NewRowIndex != -1) 408Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 409Debug.Assert(DataGridView.NewRowIndex == Count - 1); 415DataGridView.CompleteCellsCollection(dataGridViewRow); 416Debug.Assert(dataGridViewRow.Cells.Count == DataGridView.Columns.Count); 417DataGridView.OnAddingRow(dataGridViewRow, dataGridViewRow.State, checkFrozenState: true); // will throw an exception if the addition is illegal 426dataGridViewCell.OwningColumn = DataGridView.Columns[columnIndex]; 434dataGridViewRow.HeaderCell.DataGridView = DataGridView; 444DataGridView._dataStoreAccessAllowed = false; 462if (DataGridView.DataSource is not null) 467if (DataGridView.NoDimensionChangeAllowed) 481Debug.Assert(DataGridView is not null); 483if (DataGridView.NewRowIndex != -1) 485Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 486Debug.Assert(DataGridView.NewRowIndex == Count - 1); 502Debug.Assert(DataGridView is not null); 505DataGridView.OnAddingRow(rowTemplate, rowState, checkFrozenState: true); // will throw an exception if the addition is illegal 511DataGridView._dataStoreAccessAllowed = false; 533if (DataGridView.DataSource is not null) 538if (DataGridView.NoDimensionChangeAllowed) 548if (DataGridView.NewRowIndex != -1) 550Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 551Debug.Assert(DataGridView.NewRowIndex == Count - 1); 587DataGridView.OnAddingRow(rowTemplate, rowTemplateState, checkFrozenState: true); // Done once only, continue to check if this is OK - will throw an exception if the addition is illegal. 598DataGridView._dataStoreAccessAllowed = false; 602DataGridView.OnAddedRow_PreNotification(index); // Only calling this once instead of 'count' times. Continue to check if this is OK. 606DataGridView.OnAddedRow_PostNotification(index - (count - 1) + i); 616DataGridView.OnAddedRow_PreNotification(index); 620DataGridView.OnAddingRow(rowTemplate2, rowTemplateState, checkFrozenState: true); // done only once, continue to check if this is OK - will throw an exception if the addition is illegal 631DataGridView._dataStoreAccessAllowed = false; 635DataGridView.OnAddedRow_PreNotification(index); // Only calling this once instead of 'count-1' times. Continue to check if this is OK. 644DataGridView.OnAddedRow_PreNotification(index); 651DataGridView.OnAddedRow_PostNotification(index - (count - 1) + i); 671Debug.Assert(DataGridView is not null); 686dataGridViewCell.OwningColumn = DataGridView.Columns[columnIndex]; 697DataGridView.OnAddingRow(dataGridViewRow, rowState, checkFrozenState: true); // will throw an exception if the addition is illegal 700DataGridView._dataStoreAccessAllowed = false; 716Debug.Assert(DataGridView is not null); 718if (DataGridView.NoDimensionChangeAllowed) 723if (DataGridView.DataSource is not null) 728if (DataGridView.NewRowIndex != -1) 730Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 731Debug.Assert(DataGridView.NewRowIndex == Count - 1); 736if (DataGridView.Columns.Count == 0) 744DataGridView.OnAddingRows(dataGridViewRows, checkFrozenStates: true); // will throw an exception if the addition is illegal 748Debug.Assert(dataGridViewRow.Cells.Count == DataGridView.Columns.Count); 754dataGridViewCell.OwningColumn = DataGridView.Columns[columnIndex]; 769DataGridView._dataStoreAccessAllowed = false; 780DataGridView.OnAddedRows_PreNotification(dataGridViewRows); 782DataGridView.OnAddedRows_PostNotification(dataGridViewRows); 787if (DataGridView.NoDimensionChangeAllowed) 792if (DataGridView.DataSource is not null) 794if (DataGridView.DataConnection!.List is IBindingList list && list.AllowRemove && list.SupportsChangeNotification) 814DataGridView.OnClearingRows(); 824DataGridView._dataStoreAccessAllowed = false; 831DataGridView.Columns.Count != 0 && 832DataGridView.AllowUserToAddRowsInternal && 835DataGridView.AddNewRow(false); 1353Debug.Assert(DataGridView is not null); 1357if (DataGridView.VirtualMode) 1362if (DataGridView.DataSource is not null) 1367DataGridViewRow dataGridViewRow = DataGridView.RowTemplateClone; 1377if (DataGridView.DataSource is not null) 1382if (DataGridView.NoDimensionChangeAllowed) 1392if (DataGridView.DataSource is not null) 1407if (DataGridView.NoDimensionChangeAllowed) 1412if (DataGridView.Columns.Count == 0) 1417if (DataGridView.RowTemplate.Cells.Count > DataGridView.Columns.Count) 1422if (DataGridView.NewRowIndex != -1 && rowIndex == Count) 1425Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 1429DataGridViewRow rowTemplate = DataGridView.RowTemplateClone; 1430Debug.Assert(rowTemplate.Cells.Count == DataGridView.Columns.Count); 1439dataGridViewCell.OwningColumn = DataGridView.Columns[columnIndex]; 1454Debug.Assert(DataGridView is not null); 1467if (DataGridView.NewRowIndex != -1 && rowIndex == Count) 1470Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 1474if (DataGridView.Columns.Count == 0) 1479if (dataGridViewRow.Cells.Count > DataGridView.Columns.Count) 1494Debug.Assert(DataGridView is not null); 1498Debug.Assert(!DataGridView.NoDimensionChangeAllowed); 1499Debug.Assert(DataGridView.NewRowIndex == -1 || rowIndex != Count); 1506if (DataGridView.Columns.Count == 0) 1511if (dataGridViewRow.Cells.Count > DataGridView.Columns.Count) 1517DataGridView.CompleteCellsCollection(dataGridViewRow); 1518Debug.Assert(dataGridViewRow.Cells.Count == DataGridView.Columns.Count); 1519DataGridView.OnInsertingRow(rowIndex, dataGridViewRow, dataGridViewRow.State, ref newCurrentCell, true, 1, force); // will throw an exception if the insertion is illegal 1528dataGridViewCell.OwningColumn = DataGridView.Columns[columnIndex]; 1536dataGridViewRow.HeaderCell.DataGridView = DataGridView; 1545DataGridView._dataStoreAccessAllowed = false; 1567if (DataGridView.DataSource is not null) 1572if (DataGridView.NoDimensionChangeAllowed) 1582Debug.Assert(DataGridView is not null); 1599if (DataGridView.NewRowIndex != -1 && indexDestination == Count) 1602Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 1618DataGridView.OnInsertingRow(indexDestination, rowTemplate, rowTemplateState, ref newCurrentCell, firstInsertion: true, count, force: false); 1625DataGridView._dataStoreAccessAllowed = false; 1630DataGridView.OnInsertedRow_PreNotification(indexDestination, count); 1634DataGridView.OnInsertedRow_PostNotification(indexDestination + i, newCurrentCell, i == count - 1); 1639DataGridView.OnInsertingRow(indexDestination, rowTemplate, rowTemplateState, ref newCurrentCell, firstInsertion: true, insertionCount: 1, force: false); // will throw an exception if the insertion is illegal 1643DataGridView._dataStoreAccessAllowed = false; 1657DataGridView.OnInsertedRow_PreNotification(indexDestination, 1); 1662DataGridView.OnInsertingRow(indexDestination + 1, rowTemplate2, rowTemplateState, ref newCurrentCell, false, count - 1, force: false); 1669DataGridView._dataStoreAccessAllowed = false; 1674DataGridView.OnInsertedRow_PreNotification(indexDestination + 1, count - 1); 1685DataGridView.OnInsertedRow_PreNotification(indexDestination + i, 1); 1693DataGridView.OnInsertedRow_PostNotification(indexDestination + i, newCurrentCell, i == count - 1); 1710Debug.Assert(DataGridView is not null); 1720dataGridViewCell.OwningColumn = DataGridView.Columns[columnIndex]; 1731DataGridView.OnInsertingRow(indexDestination, dataGridViewRow, rowState, ref newCurrentCell, firstInsertion, 1, force: false); // will throw an exception if the insertion is illegal 1738DataGridView._dataStoreAccessAllowed = false; 1749Debug.Assert(DataGridView is not null); 1764if (DataGridView.NoDimensionChangeAllowed) 1769if (DataGridView.NewRowIndex != -1 && rowIndex == Count) 1772Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 1776if (DataGridView.DataSource is not null) 1781if (DataGridView.Columns.Count == 0) 1789DataGridView.OnInsertingRows(rowIndex, dataGridViewRows, ref newCurrentCell); // will throw an exception if the insertion is illegal 1794Debug.Assert(dataGridViewRow.Cells.Count == DataGridView.Columns.Count); 1802dataGridViewCell.OwningColumn = DataGridView.Columns[columnIndex]; 1810dataGridViewRow.HeaderCell.DataGridView = DataGridView; 1819DataGridView._dataStoreAccessAllowed = false; 1830DataGridView.OnInsertedRows_PreNotification(rowIndex, dataGridViewRows); 1832DataGridView.OnInsertedRows_PostNotification(dataGridViewRows, newCurrentCell); 1963Debug.Assert(DataGridView is not null); 1980int firstDisplayedRowIndex = DataGridView.FirstDisplayedRowIndex; 1989DataGridView.OnInsertedRow_PreNotification(rowIndex, 1); 1995useRowShortcut = DataGridView.FirstDisplayedScrollingRowIndex == -1 && 1996GetRowsHeightExceedLimit(DataGridViewElementStates.Visible, 0, rowIndex, DataGridView.LayoutInfo.Data.Height); 1998else if (DataGridView.FirstDisplayedScrollingRowIndex != -1 && 1999rowIndex > DataGridView.FirstDisplayedScrollingRowIndex) 2001useRowShortcut = GetRowsHeightExceedLimit(DataGridViewElementStates.Visible, 0, rowIndex, DataGridView.LayoutInfo.Data.Height + DataGridView.VerticalScrollingOffset) && 2002firstDisplayedRowHeight <= DataGridView.LayoutInfo.Data.Height; 2008DataGridView.OnAddedRow_PreNotification(rowIndex); 2011int displayedRowsHeightBeforeAddition = GetRowsHeight(DataGridViewElementStates.Visible) - DataGridView.VerticalScrollingOffset - dataGridViewRow.GetHeight(rowIndex); 2013useRowShortcut = DataGridView.LayoutInfo.Data.Height < displayedRowsHeightBeforeAddition && 2014firstDisplayedRowHeight <= DataGridView.LayoutInfo.Data.Height; 2032DataGridView._dataStoreAccessAllowed = false; 2034DataGridView.OnRemovedRow_PreNotification(rowIndex); 2040useRowShortcut = DataGridView.FirstDisplayedScrollingRowIndex == -1 && 2041GetRowsHeightExceedLimit(DataGridViewElementStates.Visible, 0, rowIndex, DataGridView.LayoutInfo.Data.Height + SystemInformation.HorizontalScrollBarHeight); 2043else if (DataGridView.FirstDisplayedScrollingRowIndex != -1 && 2044rowIndex > DataGridView.FirstDisplayedScrollingRowIndex) 2047int firstDisplayedRowIndex = DataGridView.FirstDisplayedRowIndex; 2053useRowShortcut = GetRowsHeightExceedLimit(DataGridViewElementStates.Visible, 0, rowIndex, DataGridView.LayoutInfo.Data.Height + DataGridView.VerticalScrollingOffset + SystemInformation.HorizontalScrollBarHeight) && 2054firstDisplayedRowHeight <= DataGridView.LayoutInfo.Data.Height; 2080DataGridView.ResetUIState(useRowShortcut, computeVisibleRows); 2093Debug.Assert(DataGridView is not null); 2096DataGridView.OnRowsRemovedInternal(rowIndex, rowCount); 2100DataGridView.OnRowsAddedInternal(rowIndex, rowCount); 2104DataGridView._dataStoreAccessAllowed = true; 2112DataGridView.OnInsertedRow_PostNotification(rowIndex, newCurrentCell, true); 2116DataGridView.OnAddedRow_PostNotification(rowIndex); 2124DataGridView.OnRemovedRow_PostNotification(dataGridViewRow, newCurrentCell); 2132DataGridView.OnClearedRows(); 2139DataGridView.OnRowCollectionChanged_PostNotification(recreateNewRow, newCurrentCell.X == -1, cca, dataGridViewRow, rowIndex); 2146if (dataGridViewRow.DataGridView != DataGridView) 2168if (DataGridView.NewRowIndex == index) 2170Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 2174if (DataGridView.NoDimensionChangeAllowed) 2179if (DataGridView.IsAccessibilityObjectCreated && OsVersion.IsWindows8OrGreater() && this[index] is DataGridViewRow row) 2190if (DataGridView.DataSource is not null) 2192if (DataGridView.DataConnection!.List is IBindingList bindingList && bindingList.AllowRemove && bindingList.SupportsChangeNotification) 2212Debug.Assert(DataGridView is not null); 2213Debug.Assert(!DataGridView.NoDimensionChangeAllowed); 2224Debug.Assert(DataGridView is not null); 2225DataGridView.OnRemovingRow(index, out newCurrentCell, force); 2383DataGridView.SwapSortedRows(rowIndex1, rowIndex2); 2398if (DataGridView.VirtualMode) 2401int columnCount = DataGridView.Columns.Count;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.RowComparer.cs (1)
22_dataGridView = dataGridViewRows.DataGridView;