25 writes to OwningRow
System.Windows.Forms (25)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (3)
10820dataGridViewCellNew.OwningRow = dataGridViewRow; 10972dataGridViewCellNew.OwningRow = dataGridViewRow; 15455dataGridViewCellNew.OwningRow = dataGridViewRow;
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (3)
240headerCell.OwningRow = (DataGridViewRow)this; // may be a shared row 269priorValue.OwningRow = null; 296value.OwningRow = (DataGridViewRow)this; // may be a shared row
System\Windows\Forms\Controls\DataGridView\DataGridViewCellCollection.cs (8)
86dataGridViewCell.OwningRow = _owner; 96oldDataGridViewCell.OwningRow = null; 176dataGridViewCell.OwningRow = _owner; 226dataGridViewCell.OwningRow = _owner; 242dataGridViewCell.OwningRow = null; 280dataGridViewCell.OwningRow = _owner; 288dataGridViewCell.OwningRow = _owner; 346dataGridViewCell.OwningRow = null;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (11)
146dataGridViewCell.OwningRow = newDataGridViewRow; 154newDataGridViewRow.HeaderCell.OwningRow = newDataGridViewRow; 249dataGridViewRow.HeaderCell.OwningRow = dataGridViewRow; 365rowTemplate.HeaderCell.OwningRow = rowTemplate; 435dataGridViewRow.HeaderCell.OwningRow = dataGridViewRow; 694dataGridViewRow.HeaderCell.OwningRow = dataGridViewRow; 761dataGridViewRow.HeaderCell.OwningRow = dataGridViewRow; 1446rowTemplate.HeaderCell.OwningRow = rowTemplate; 1537dataGridViewRow.HeaderCell.OwningRow = dataGridViewRow; 1728dataGridViewRow.HeaderCell.OwningRow = dataGridViewRow; 1811dataGridViewRow.HeaderCell.OwningRow = dataGridViewRow;
189 references to OwningRow
System.Windows.Forms (135)
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (2)
293value.OwningRow?.HeaderCell = null; 295Debug.Assert(value.OwningRow is null);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.DataGridViewButtonCellAccessibleObject.cs (1)
44if (dataGridViewCell.OwningColumn is not null && dataGridViewCell.OwningRow is not null)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (50)
164return OwningColumn!.Displayed && OwningRow!.Displayed; 266return OwningColumn!.Frozen && OwningRow!.Frozen; 268else if (OwningRow is not null && (OwningRow.DataGridView is null || RowIndex >= 0)) 270return OwningRow.Frozen; 437if (OwningRow is not null && (OwningRow.DataGridView is null || RowIndex >= 0) && OwningRow.ReadOnly) 469if (OwningRow is null) 479OwningRow.SetReadOnlyCellCore(this, value); 507if (OwningRow is not null && (OwningRow.DataGridView is null || RowIndex >= 0) && OwningRow.Resizable == DataGridViewTriState.True) 526public int RowIndex => OwningRow?.Index ?? -1; 539if (OwningRow is not null && (OwningRow.DataGridView is null || RowIndex >= 0) && OwningRow.Selected) 752return OwningColumn!.Visible && OwningRow!.Visible; 754else if (OwningRow is not null && (OwningRow.DataGridView is null || RowIndex >= 0)) 756return OwningRow.Visible; 872if (OwningRow is not null) 874rect.Height += OwningRow.DividerHeight; 989else if (OwningRow is not null) 993dgvabsEffective = OwningRow.AdjustRowHeaderBorderStyle(DataGridView.AdvancedRowHeadersBorderStyle, 999cellState = OwningRow.GetState(rowIndex) | State; 1004Debug.Assert(OwningRow is null); 1719Debug.Assert(OwningRow is not null); 1720return OwningRow.GetHeight(rowIndex); 1744if (OwningRow is not null) 1746contextMenuStrip = OwningRow.GetContextMenuStrip(rowIndex); 1784if (OwningRow is not null) 1786state |= (OwningRow.GetState(-1) & (DataGridViewElementStates.Frozen | DataGridViewElementStates.ReadOnly | DataGridViewElementStates.Selected | DataGridViewElementStates.Visible)); 1787if (OwningRow.GetResizable(rowIndex) == DataGridViewTriState.True) 1801Debug.Assert(OwningRow is not null); 1804if (DataGridView.Rows.SharedRow(rowIndex) != OwningRow) 1813if (OwningRow.GetResizable(rowIndex) == DataGridViewTriState.True || 1819if (OwningColumn.Visible && OwningRow.GetVisible(rowIndex)) 1822if (OwningColumn.Displayed && OwningRow.GetDisplayed(rowIndex)) 1828if (OwningColumn.Frozen && OwningRow.GetFrozen(rowIndex)) 2361Debug.Assert(OwningRow is not null); 2362return new Size(OwningColumn.Thickness, OwningRow.GetHeight(rowIndex)); 2725if (rowIndex != -1 && OwningRow is not null && OwningColumn is not null) 2727int width = GetPreferredWidth(rowIndex, OwningRow.Height); 2730if (OwningColumn.Width < width || OwningRow.Height < height) 2744else if ((rowIndex != -1 && OwningRow is not null && DataGridView.RowHeadersVisible && DataGridView.RowHeadersWidth > 0 && OwningColumn is null) || 3181dividerThickness = OwningRow?.DividerHeight ?? 0; 3901if (DataGridView is null || OwningRow is null || OwningRow.DataGridView is null) 3913if (OwningRow.Index == DataGridView.CurrentCellAddress.Y)
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.DataGridViewCellAccessibleObject.cs (27)
55if (_owner.OwningColumn is null || _owner.OwningRow is null) 62: _owner.DataGridView.Rows.GetVisibleIndex(_owner.OwningRow) + RowStartIndex; 116return _owner.OwningRow?.AccessibilityObject; 155if (_owner.OwningColumn is not null && _owner.OwningRow is not null) 157cellBounds = _owner.DataGridView.GetCellDisplayRectangle(_owner.OwningColumn.Index, _owner.OwningRow.Index, cutOverflow: false); 159else if (_owner.OwningRow is not null) 161cellBounds = _owner.DataGridView.GetCellDisplayRectangle(-1, _owner.OwningRow.Index, cutOverflow: false); 224if (_owner is DataGridViewHeaderCell || _owner.ReadOnly || _owner.DataGridView is null || _owner.OwningRow is null) 241_owner.OwningRow.Index, 442if (_owner.DataGridView?.IsHandleCreated != true || _owner.OwningColumn is null || _owner.OwningRow is null) 466if (_owner.OwningRow.Index == _owner.DataGridView.Rows.GetFirstRow(DataGridViewElementStates.Visible)) 474int previousVisibleRow = _owner.DataGridView.Rows.GetPreviousRow(_owner.OwningRow.Index, DataGridViewElementStates.Visible); 479if (_owner.OwningRow.Index == _owner.DataGridView.Rows.GetLastRow(DataGridViewElementStates.Visible)) 485int nextVisibleRow = _owner.DataGridView.Rows.GetNextRow(_owner.OwningRow.Index, DataGridViewElementStates.Visible); 499Debug.Assert(_owner.OwningRow is not null); 506AccessibleObject? previousRow = _owner.OwningRow.AccessibilityObject.Navigate(AccessibleNavigation.Previous); 518return _owner.DataGridView.RowHeadersVisible ? _owner.OwningRow.AccessibilityObject.GetChild(0) : null; 527return _owner.OwningRow.Cells[previousVisibleColumnIndex].AccessibilityObject; 536Debug.Assert(_owner.OwningRow is not null); 545AccessibleObject? nextRow = _owner.OwningRow.AccessibilityObject.Navigate(AccessibleNavigation.Next); 560return _owner.OwningRow.Cells[nextVisibleColumnIndex].AccessibilityObject; 645if (_owner.DataGridView?.IsHandleCreated != true || _owner.OwningColumn is null || _owner.OwningRow is null) 653return _owner.OwningRow.AccessibilityObject; 718if (_owner is { OwningRow.HasHeaderCell: true, DataGridView: { IsHandleCreated: true, RowHeadersVisible: true } }) 720return [_owner.OwningRow.HeaderCell.AccessibilityObject]; 737=> _owner?.OwningRow?.Visible is true && _owner.DataGridView is not null 738? _owner.DataGridView.Rows.GetVisibleIndex(_owner.OwningRow)
System\Windows\Forms\Controls\DataGridView\DataGridViewCellCollection.cs (4)
77if (dataGridViewCell.OwningRow is not null) 163if (dataGridViewCell.OwningRow is not null) 204if (dataGridViewCell.OwningRow is not null) 272if (dataGridViewCell.OwningRow is not null)
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.DataGridViewCheckBoxCellAccessibleObject.cs (1)
100if (!dataGridViewCell.ReadOnly && dataGridViewCell.OwningColumn is not null && dataGridViewCell.OwningRow is not null)
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (19)
61if (OwningRow is not null) 64return DataGridView.RowHeadersVisible && OwningRow.Displayed; 91if (OwningRow is not null) 94return OwningRow.Frozen; 129if (OwningRow is not null) 132return (OwningRow.Resizable == DataGridViewTriState.True) || (DataGridView is not null && DataGridView.RowHeadersWidthSizeMode == DataGridViewRowHeadersWidthSizeMode.EnableResizing); 166if (OwningRow is not null) 169return OwningRow.Visible && 230if (OwningRow is not null) 239if (DataGridView is not null && DataGridView.Rows.SharedRow(rowIndex) != OwningRow) 244state |= (OwningRow.GetState(rowIndex) & DataGridViewElementStates.Frozen); 245if (OwningRow.GetResizable(rowIndex) == DataGridViewTriState.True || (DataGridView is not null && DataGridView.RowHeadersWidthSizeMode == DataGridViewRowHeadersWidthSizeMode.EnableResizing)) 250if (OwningRow.GetVisible(rowIndex) && (DataGridView is null || DataGridView.RowHeadersVisible)) 253if (OwningRow.GetDisplayed(rowIndex)) 302if (OwningRow is null || OwningRow.Index != -1) 359else if (OwningRow is not null) 365if (DataGridView.Rows.SharedRow(rowIndex) != OwningRow) 370return new Size(DataGridView.RowHeadersWidth, OwningRow.GetHeight(rowIndex));
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.DataGridViewImageCellAccessibleObject.cs (1)
49dataGridViewCell.OwningRow is not null)
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.DataGridViewLinkCellAccessibleObject.cs (1)
42if (dataGridViewCell.OwningColumn is not null && dataGridViewCell.OwningRow is not null)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (7)
241Debug.Assert(dataGridViewCell.OwningRow == dataGridViewRow); 357Debug.Assert(dataGridViewCell.OwningRow == rowTemplate); 423Debug.Assert(dataGridViewCell.OwningRow == dataGridViewRow); 753Debug.Assert(dataGridViewCell.OwningRow == dataGridViewRow); 1438Debug.Assert(dataGridViewCell.OwningRow == rowTemplate); 1525Debug.Assert(dataGridViewCell.OwningRow == dataGridViewRow); 1799Debug.Assert(dataGridViewCell.OwningRow == dataGridViewRow);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (5)
187if (DataGridView is null || OwningRow is null) 288OwningRow is null 290: OwningRow.GetErrorText(rowIndex); 521Debug.Assert(OwningRow is not null); 522DataGridViewAdvancedBorderStyle dgvabsEffective = OwningRow.AdjustRowHeaderBorderStyle(
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.DataGridViewRowHeaderCellAccessibleObject.cs (17)
27if (Owner.DataGridView is null || Owner.OwningRow is null || ParentPrivate is null) 78return Owner.OwningRow?.AccessibilityObject; 106if (Owner.OwningRow is not null && Owner.OwningRow.Selected) 126Owner.OwningRow is not null && 130Owner.OwningRow.Selected = true; 141if (Owner.OwningRow is null || Owner.DataGridView is null) 155if (Owner.OwningRow.Index == Owner.DataGridView.Rows.GetLastRow(DataGridViewElementStates.Visible)) 160int nextVisibleRow = Owner.DataGridView.Rows.GetNextRow(Owner.OwningRow.Index, DataGridViewElementStates.Visible); 174if (Owner.OwningRow.Index == Owner.DataGridView.Rows.GetFirstRow(DataGridViewElementStates.Visible)) 187int previousVisibleRow = Owner.DataGridView.Rows.GetPreviousRow(Owner.OwningRow.Index, DataGridViewElementStates.Visible); 228if (dataGridViewCell.OwningRow is not null && 234dataGridViewCell.OwningRow.Selected = true; 238dataGridViewCell.OwningRow.Selected = false; 252if (Owner.OwningRow is null) 259NavigateDirection.NavigateDirection_Parent => Owner.OwningRow.AccessibilityObject, 262? Owner.OwningRow.AccessibilityObject.GetChild(1) // go to the next sibling
System.Windows.Forms.Tests (54)
System\Windows\Forms\AccessibleObjects\DataGridViewCellAccessibleObjectTests.cs (1)
1078Assert.Null(accessibleObject.Owner.OwningRow);
System\Windows\Forms\AccessibleObjects\DataGridViewRowHeaderCellAccessibleObjectTests.cs (6)
35Assert.Equal(cell.OwningRow.AccessibilityObject, accessibleObject.Parent); 97Assert.False(cell.OwningRow.Selected); 101Assert.Equal(expected, cell.OwningRow.Selected); 116Assert.False(cell.OwningRow.Selected); 120Assert.False(cell.OwningRow.Selected); 157Assert.Null(accessibleObject.Owner.OwningRow);
System\Windows\Forms\DataGridViewCellTests.cs (3)
38Assert.Null(cell.OwningRow); 3336Assert.Null(cell.OwningRow); 3375Assert.Null(cell.OwningRow);
System\Windows\Forms\DataGridViewColumnTests.cs (2)
1352Assert.Null(column.HeaderCell.OwningRow); 1364Assert.Null(column.HeaderCellCore.OwningRow);
System\Windows\Forms\DataGridViewHeaderCellTests.cs (5)
36Assert.Null(cell.OwningRow); 2038Assert.Null(cell.OwningRow); 2077Assert.Null(cell.OwningRow); 2124Assert.Null(cell.OwningRow); 2163Assert.Null(cell.OwningRow);
System\Windows\Forms\DataGridViewRowTests.cs (21)
36Assert.Equal(row, row.HeaderCell.OwningRow); 1378Assert.Same(row, row.HeaderCell.OwningRow); 1396Assert.Same(row, row.HeaderCell.OwningRow); 1414Assert.Same(row, row.HeaderCell.OwningRow); 1425Assert.Same(row, row.HeaderCellCore.OwningRow); 1443Assert.Same(row, row.HeaderCellCore.OwningRow); 1461Assert.Same(row, row.HeaderCellCore.OwningRow); 1490Assert.Equal(row, row.HeaderCell.OwningRow); 1503Assert.Equal(row, row.HeaderCell.OwningRow); 1526Assert.Equal(row, row.HeaderCell.OwningRow); 1539Assert.Equal(row, row.HeaderCell.OwningRow); 1556Assert.Equal(row, row.HeaderCell.OwningRow); 1562Assert.Equal(row, row.HeaderCell.OwningRow); 1586Assert.Equal(row, row.HeaderCell.OwningRow); 1599Assert.Equal(row, row.HeaderCell.OwningRow); 1626Assert.Equal(row, row.HeaderCell.OwningRow); 1639Assert.Equal(row, row.HeaderCell.OwningRow); 1663Assert.Equal(row, row.HeaderCell.OwningRow); 1676Assert.Equal(row, row.HeaderCell.OwningRow); 1703Assert.Equal(row, row.HeaderCell.OwningRow); 1716Assert.Equal(row, row.HeaderCell.OwningRow);
System\Windows\Forms\DataGridViewTests.cs (16)
1747Assert.Null(cell1.OwningRow); 1755Assert.Null(cell1.OwningRow); 1764Assert.Null(cell1.OwningRow); 1767Assert.Null(cell2.OwningRow); 1775Assert.Null(cell.OwningRow); 1779Assert.Null(cell1.OwningRow); 1782Assert.Null(cell2.OwningRow); 1811Assert.Null(cell1.OwningRow); 1821Assert.Null(cell1.OwningRow); 1832Assert.Null(cell1.OwningRow); 1835Assert.Null(cell2.OwningRow); 1845Assert.Null(cell.OwningRow); 1849Assert.Null(cell1.OwningRow); 1852Assert.Null(cell2.OwningRow); 1873Assert.Null(cell.OwningRow); 1901Assert.Null(cell.OwningRow);