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