1 write to _ptCurrentCell
System.Windows.Forms (1)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
471
_ptCurrentCell
= new Point(-1, -1);
944 references to _ptCurrentCell
System.Windows.Forms (944)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (49)
1131
if (
_ptCurrentCell
.X != -1 && ColumnEditable(
_ptCurrentCell
.X))
1136
if (!IsSharedCellReadOnly(dataGridViewCell,
_ptCurrentCell
.Y))
1707
if (
_ptCurrentCell
.X == -1 &&
_ptCurrentCell
.Y == -1)
1712
Debug.Assert(
_ptCurrentCell
.X >= 0 &&
_ptCurrentCell
.Y >= 0);
1713
Debug.Assert(
_ptCurrentCell
.X < Columns.Count);
1714
Debug.Assert(
_ptCurrentCell
.Y < Rows.Count);
1715
DataGridViewRow dataGridViewRow = Rows[
_ptCurrentCell
.Y]; // un-sharing row
1716
return dataGridViewRow.Cells[
_ptCurrentCell
.X];
1720
if ((value is not null && (value.RowIndex !=
_ptCurrentCell
.Y || value.ColumnIndex !=
_ptCurrentCell
.X))
1721
|| (value is null &&
_ptCurrentCell
.X != -1))
1775
public Point CurrentCellAddress =>
_ptCurrentCell
;
1781
Debug.Assert(
_ptCurrentCell
.X >= 0 &&
_ptCurrentCell
.X < Columns.Count);
1782
Debug.Assert(
_ptCurrentCell
.Y >= 0 &&
_ptCurrentCell
.Y < Rows.Count);
1783
DataGridViewRow dataGridViewRow = Rows.SharedRow(
_ptCurrentCell
.Y);
1785
DataGridViewCell dataGridViewCell = dataGridViewRow.Cells[
_ptCurrentCell
.X];
1786
Debug.Assert(IsSharedCellVisible(dataGridViewCell,
_ptCurrentCell
.Y));
1795
if (
_ptCurrentCell
.X == -1)
1800
Debug.Assert(
_ptCurrentCell
.Y != -1);
1802
bool previousVisibleColumnExists = (Columns.GetPreviousColumn(Columns[
_ptCurrentCell
.X], DataGridViewElementStates.Visible, DataGridViewElementStates.None) is not null);
1803
bool previousVisibleRowExists = (Rows.GetPreviousRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible) != -1);
1813
if (
_ptCurrentCell
.X == -1)
1818
Debug.Assert(
_ptCurrentCell
.Y != -1);
1820
bool nextVisibleColumnExists = (Columns.GetNextColumn(Columns[
_ptCurrentCell
.X], DataGridViewElementStates.Visible, DataGridViewElementStates.None) is not null);
1821
bool nextVisibleRowExists = (Rows.GetNextRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible) != -1);
1831
if (
_ptCurrentCell
.X == -1)
1836
Debug.Assert(
_ptCurrentCell
.Y != -1);
1849
if (
_ptCurrentCell
.X == -1)
1854
Debug.Assert(
_ptCurrentCell
.Y >= 0);
1855
Debug.Assert(
_ptCurrentCell
.Y < Rows.Count);
1857
return Rows[
_ptCurrentCell
.Y];
2487
if (
_ptCurrentCell
.X >= 0
2567
if (
_ptCurrentCell
.X >= 0
2744
&& !Columns[
_ptCurrentCell
.X].Frozen
2849
=>
_ptCurrentCell
.X == -1 ? null : CurrentCellInternal.GetInheritedStyleInternal(
_ptCurrentCell
.Y);
2900
if (RowHeadersVisible && ShowEditingIcon &&
_ptCurrentCell
.Y >= 0)
2903
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
3070
if (value &&
_ptCurrentCell
.X != -1 && IsCurrentCellInEditMode)
3142
if (
_ptCurrentCell
.X != -1 && !SetCurrentCellAddressCore(
3894
Debug.Assert(
_ptCurrentCell
.Y >= 0);
3895
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
3902
Debug.Assert(
_ptCurrentCell
.Y >= 0);
3903
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (895)
2564
public virtual bool BeginEdit(bool selectAll) =>
_ptCurrentCell
.X == -1
2578
Debug.Assert(
_ptCurrentCell
.X >= 0 &&
_ptCurrentCell
.X < Columns.Count);
2579
Debug.Assert(
_ptCurrentCell
.Y >= 0 &&
_ptCurrentCell
.Y < Rows.Count);
2585
if (IsSharedCellReadOnly(dataGridViewCell,
_ptCurrentCell
.Y) || !ColumnEditable(
_ptCurrentCell
.X))
2601
DataGridViewCellCancelEventArgs dgvcce = new(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
2610
if (
_ptCurrentCell
.X > -1)
2618
if (IsSharedCellReadOnly(dataGridViewCell,
_ptCurrentCell
.Y) || !ColumnEditable(
_ptCurrentCell
.X))
2640
DataGridViewCellStyle dataGridViewCellStyle = dataGridViewCell.GetInheritedStyle(inheritedCellStyle: null,
_ptCurrentCell
.Y, includeColors: true);
2682
((IDataGridViewEditingControl)EditingControl).EditingControlRowIndex =
_ptCurrentCell
.Y;
2702
if (_toolTipControl.Activated && _ptToolTipCell ==
_ptCurrentCell
)
2719
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3038
if (
_ptCurrentCell
.X != -1)
3040
Debug.Assert(
_ptCurrentCell
.Y != -1);
3042
int oldCurrentCellX =
_ptCurrentCell
.X;
3100
_ptCurrentCell
.X,
3101
_ptCurrentCell
.Y,
3126
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3130
else if (
_ptCurrentCell
.X == -1 && Focused)
3200
int oldCurrentCellX =
_ptCurrentCell
.X;
3205
if (currentCellDirty ||
_ptCurrentCell
.Y == -1 ||
_ptCurrentCell
.X == -1)
3233
if (
_ptCurrentCell
.Y > -1)
3235
InvalidateRowPrivate(
_ptCurrentCell
.Y);
3239
DataGridViewCellStyle dataGridViewCellStyle = dataGridViewCell.GetInheritedStyle(inheritedCellStyle: null,
_ptCurrentCell
.Y, includeColors: true);
3256
if (discardNewRow &&
_ptCurrentCell
.Y == NewRowIndex - 1)
3264
if (!IsCurrentRowDirty &&
_ptCurrentCell
.Y == NewRowIndex - 1 && _dataGridViewState1[State1_NewRowCreatedByEditing])
3304
if (
_ptCurrentCell
.X > -1)
3350
if ((DataConnection.CurrencyManager?.Count ?? 0) <=
_ptCurrentCell
.Y)
3419
if (
_ptCurrentCell
.X != -1 && SelectionMode == DataGridViewSelectionMode.FullRowSelect)
3421
InvalidateCellPrivate(
_ptCurrentCell
.X, -1);
3757
Debug.Assert(
_ptCurrentCell
.X > -1);
3760
if (
_ptCurrentCell
.X == -1)
3765
OnCellLeave(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3770
if (
_ptCurrentCell
.X == -1)
3775
OnRowLeave(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3786
if (
_ptCurrentCell
.X > -1 &&
_ptCurrentCell
.Y > -1)
3788
InvalidateCellPrivate(columnIndex:
_ptCurrentCell
.X, rowIndex:
_ptCurrentCell
.Y);
3796
if (
_ptCurrentCell
.X == -1)
3801
if (OnCellValidating(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y, context))
3805
if (
_ptCurrentCell
.X == -1)
3812
_ptCurrentCell
.X,
3813
_ptCurrentCell
.Y,
3820
if (
_ptCurrentCell
.X == -1)
3825
OnCellEnter(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3828
if (
_ptCurrentCell
.X == -1)
3835
_ptCurrentCell
.X,
3836
_ptCurrentCell
.Y,
3846
if (
_ptCurrentCell
.X == -1)
3851
OnCellValidated(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3856
if (
_ptCurrentCell
.X == -1 || !IsCurrentCellInEditMode)
3872
Debug.Assert(
_ptCurrentCell
.X > -1);
3873
if (
_ptCurrentCell
.X == -1)
3878
if (OnCellValidating(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y, context))
3880
if (
_ptCurrentCell
.X == -1)
3887
_ptCurrentCell
.X,
3888
_ptCurrentCell
.Y,
3912
if (
_ptCurrentCell
.X == -1)
3919
_ptCurrentCell
.X,
3920
_ptCurrentCell
.Y,
3954
if (
_ptCurrentCell
.X == -1)
3959
OnCellValidated(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
4019
Debug.Assert(
_ptCurrentCell
.X > -1);
4020
if (
_ptCurrentCell
.X == -1)
4025
int columnIndex =
_ptCurrentCell
.X;
4026
int rowIndex =
_ptCurrentCell
.Y;
4070
fireRowLeave:
_ptCurrentCell
.Y != rowIndex,
4071
fireRowEnter:
_ptCurrentCell
.Y != rowIndex,
4080
if (
_ptCurrentCell
.Y != rowIndex &&
_ptCurrentCell
.Y != -1)
4083
int columnIndexTmp =
_ptCurrentCell
.X;
4084
int rowIndexTmp =
_ptCurrentCell
.Y;
4135
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
4155
if (forCurrentCellChange &&
_ptCurrentCell
.X == -1 && lastVisibleRowIndex != -1)
5474
Debug.Assert(
_ptCurrentCell
.Y == NewRowIndex);
5734
Debug.Assert(
_ptCurrentCell
.X != -1);
5947
Debug.Assert(
_ptCurrentCell
.X != -1);
5957
Debug.Assert(
_ptCurrentCell
.X != -1);
6159
if (
_ptCurrentCell
.X == -1)
6167
int curRowIndex =
_ptCurrentCell
.Y;
6168
int curColIndex =
_ptCurrentCell
.X;
6212
if (curRowIndex !=
_ptCurrentCell
.Y || curColIndex !=
_ptCurrentCell
.X)
6236
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
6263
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
8815
|| (
_ptCurrentCell
.Y != -1 && (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Frozen) == 0))
8867
if (((_ptAnchorCell.X != -1 && !Columns[_ptAnchorCell.X].Frozen) || (
_ptCurrentCell
.X != -1 && !Columns[
_ptCurrentCell
.X].Frozen))
9683
_uneditedFormattedValue = dataGridViewCell.GetFormattedValue(
_ptCurrentCell
.Y, ref dataGridViewCellStyle, DataGridViewDataErrorContexts.Formatting);
9693
Debug.Assert(
_ptCurrentCell
.X == dataGridViewCell.ColumnIndex);
9694
dataGridViewCell = Rows[
_ptCurrentCell
.Y].Cells[
_ptCurrentCell
.X]; // un-share the edited cell
9704
_ptCurrentCell
.X,
9705
_ptCurrentCell
.Y,
9724
object? initialFormattedValue = dataGridViewCell.GetFormattedValue(
_ptCurrentCell
.Y, ref dataGridViewCellStyle, DataGridViewDataErrorContexts.Formatting);
9729
dataGridViewCell.InitializeEditingControl(
_ptCurrentCell
.Y, initialFormattedValue, dataGridViewCellStyle);
9736
_ptCurrentCell
.X,
9737
_ptCurrentCell
.Y,
10107
&&
_ptCurrentCell
.X != -1)
12048
if (
_ptCurrentCell
.X == -1)
12065
if (
_ptCurrentCell
.X >= 0 && (
_ptCurrentCell
.X != hti._col ||
_ptCurrentCell
.Y != hti._row))
12067
Point ptOriginalCurrentCell =
_ptCurrentCell
;
12070
forCurrentCellChange:
_ptCurrentCell
.X != hti._col ||
_ptCurrentCell
.Y != hti._row,
12071
forCurrentRowChange:
_ptCurrentCell
.Y != hti._row))
12077
if (
_ptCurrentCell
!= ptOriginalCurrentCell)
12090
if (
_ptCurrentCell
.X == -1 && dataGridViewLastVisibleColumn is not null)
12106
if (
_ptCurrentCell
.X == -1 && lastVisibleRowIndex != -1)
12152
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
12153
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
12342
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
12343
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
12548
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
12549
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
12762
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
12763
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
12764
if ((hti._col !=
_ptCurrentCell
.X || hti._row !=
_ptCurrentCell
.Y)
12787
if (hti._col !=
_ptCurrentCell
.X || hti._row !=
_ptCurrentCell
.Y)
12821
&&
_ptCurrentCell
.X == dataGridViewCell.ColumnIndex
12822
&&
_ptCurrentCell
.Y == dataGridViewCell.RowIndex
12829
&& ColumnEditable(
_ptCurrentCell
.X)
13697
if (rowIndex > -1 && hti._col !=
_ptCurrentCell
.X)
13700
int oldCurrentCellX =
_ptCurrentCell
.X;
13701
int oldCurrentCellY =
_ptCurrentCell
.Y;
13707
fireRowLeave: rowIndex !=
_ptCurrentCell
.Y,
13708
fireRowEnter: rowIndex !=
_ptCurrentCell
.Y,
13839
if (hti._col !=
_ptCurrentCell
.X)
13861
else if (
_ptCurrentCell
.X != -1)
13865
_ptCurrentCell
.X,
13866
_ptCurrentCell
.Y,
14126
if (
_ptCurrentCell
.X != -1 && hti._col !=
_ptCurrentCell
.X && !CommitEditForOperation(hti._col,
_ptCurrentCell
.Y, true))
14208
if (
_ptCurrentCell
.X != -1 && hti._col !=
_ptCurrentCell
.X)
14210
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(hti._col))
14217
_ptCurrentCell
.Y,
14436
&& dataGridViewColumn.Index ==
_ptCurrentCell
.X
14442
&& ColumnEditable(
_ptCurrentCell
.X)
14443
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.ReadOnly) == 0
14519
PositionEditingControl(
_ptCurrentCell
.X != e.Column.Index, true, false);
14547
|| (columnIndex ==
_ptCurrentCell
.X && rowIndex ==
_ptCurrentCell
.Y))))
14578
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
14581
if (IsCurrentCellDirty && NewRowIndex ==
_ptCurrentCell
.Y)
14722
else if (dataGridViewColumn.Visible &&
_ptCurrentCell
.X == dataGridViewColumn.Index)
14743
if (
_ptCurrentCell
.X == dataGridViewColumn.Index
14783
if (elementState == DataGridViewElementStates.Visible &&
_ptCurrentCell
.Y == rowIndex)
14791
Debug.Assert(DataConnection.CurrencyManager.Position ==
_ptCurrentCell
.Y);
14805
if (
_ptCurrentCell
.Y == rowIndex
14843
if (
_ptCurrentCell
.X == dataGridViewCell.ColumnIndex
14844
&&
_ptCurrentCell
.Y == dataGridViewCell.RowIndex
14960
if (Focused && EditMode == DataGridViewEditMode.EditOnEnter &&
_ptCurrentCell
.X > -1 && !IsCurrentCellInEditMode)
15013
if (
_ptCurrentCell
.X > -1)
15021
_ptCurrentCell
.X,
15022
_ptCurrentCell
.Y,
15025
if (
_ptCurrentCell
.X == -1)
15030
OnCellEnter(ref dataGridViewCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
15035
InvalidateCellPrivate(
_ptCurrentCell
.X, -1);
15044
if (
_ptCurrentCell
.X > -1 && !IsCurrentCellInEditMode)
15050
if (
_ptCurrentCell
.X > -1 && CurrentCellInternal.EditType is null && !_dataGridViewOper[OperationInMouseDown])
15055
InvalidateCellPrivate(columnIndex:
_ptCurrentCell
.X, rowIndex:
_ptCurrentCell
.Y);
15064
InvalidateCellPrivate(columnIndex:
_ptCurrentCell
.X, rowIndex:
_ptCurrentCell
.Y);
15187
if (
_ptCurrentCell
.X != -1)
15189
InvalidateCell(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
15196
&&
_ptCurrentCell
.X > -1)
15201
AccessibilityNotifyCurrentCellChanged(
_ptCurrentCell
);
15229
if (
_ptCurrentCell
.X == -1)
15235
ScrollIntoView(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, forCurrentCellChange: false);
15271
Debug.Assert(
_ptCurrentCell
.X == -1);
15309
Debug.Assert(
_ptCurrentCell
.X == -1);
15349
Debug.Assert(
_ptCurrentCell
.X == -1);
15408
if (
_ptCurrentCell
.X != -1)
15410
newCurrentCell = new Point(columnIndexInserted <=
_ptCurrentCell
.X ?
_ptCurrentCell
.X + 1 :
_ptCurrentCell
.X,
15411
_ptCurrentCell
.Y);
15528
if (
_ptCurrentCell
.Y != -1 && rowIndexInserted <=
_ptCurrentCell
.Y)
15530
newCurrentCell = new Point(
_ptCurrentCell
.X,
_ptCurrentCell
.Y + insertionCount);
15611
if (
_ptCurrentCell
.Y != -1 && rowIndexInserted <=
_ptCurrentCell
.Y)
15613
newCurrentCell = new Point(
_ptCurrentCell
.X,
_ptCurrentCell
.Y + dataGridViewRows.Length);
15676
if (
_ptCurrentCell
.X != -1)
15680
if (dataGridViewCell.KeyDownUnsharesRowInternal(e,
_ptCurrentCell
.Y))
15683
_ = Rows[
_ptCurrentCell
.Y];
15684
CurrentCellInternal.OnKeyDownInternal(e,
_ptCurrentCell
.Y);
15688
dataGridViewCell.OnKeyDownInternal(e,
_ptCurrentCell
.Y);
15735
if (
_ptCurrentCell
.X != -1)
15739
if (dataGridViewCell.KeyPressUnsharesRowInternal(e,
_ptCurrentCell
.Y))
15742
_ = Rows[
_ptCurrentCell
.Y];
15743
CurrentCellInternal.OnKeyPressInternal(e,
_ptCurrentCell
.Y);
15747
dataGridViewCell.OnKeyPressInternal(e,
_ptCurrentCell
.Y);
15769
if (
_ptCurrentCell
.X != -1)
15773
if (dataGridViewCell.KeyUpUnsharesRowInternal(e,
_ptCurrentCell
.Y))
15776
_ = Rows[
_ptCurrentCell
.Y];
15777
CurrentCellInternal.OnKeyUpInternal(e,
_ptCurrentCell
.Y);
15781
dataGridViewCell.OnKeyUpInternal(e,
_ptCurrentCell
.Y);
15812
if (
_ptCurrentCell
.X > -1 && !_dataGridViewState1[State1_LeavingWithTabKey])
15815
OnCellLeave(ref dataGridViewCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
15816
if (
_ptCurrentCell
.X == -1)
15821
OnRowLeave(ref dataGridViewCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
15829
if (
_ptCurrentCell
.X > -1 &&
_ptCurrentCell
.Y > -1)
15831
InvalidateCellPrivate(columnIndex:
_ptCurrentCell
.X, rowIndex:
_ptCurrentCell
.Y);
15845
if (
_ptCurrentCell
.X != -1)
15847
InvalidateCell(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
15875
|| (_ptMouseDownCell.X ==
_ptCurrentCell
.X && _ptMouseDownCell.Y ==
_ptCurrentCell
.Y)))
16504
if (
_ptCurrentCell
.X >= 0 && !CommitEdit(
16547
if (
_ptCurrentCell
.X >= 0 && !CommitEdit(
16856
&&
_ptCurrentCell
.X != -1
16857
&& ColumnEditable(
_ptCurrentCell
.X)
16861
&& !Rows[
_ptCurrentCell
.Y].Cells[
_ptCurrentCell
.X].ReadOnly) // Un-shares the row
16896
Debug.Assert(
_ptCurrentCell
.X == -1);
16947
Debug.Assert(
_ptCurrentCell
.X == -1);
17029
if (
_ptCurrentCell
.X != -1)
17031
int newX =
_ptCurrentCell
.X;
17032
if (columnIndex ==
_ptCurrentCell
.X)
17059
else if (columnIndex <
_ptCurrentCell
.X)
17061
newX =
_ptCurrentCell
.X - 1;
17064
newCurrentCell = new Point(newX, (newX == -1) ? -1 :
_ptCurrentCell
.Y);
17065
if (columnIndex ==
_ptCurrentCell
.X)
17251
if (
_ptCurrentCell
.Y != -1 && rowIndexDeleted <=
_ptCurrentCell
.Y)
17254
if (rowIndexDeleted ==
_ptCurrentCell
.Y)
17275
Debug.Assert(rowIndexDeleted <
_ptCurrentCell
.Y);
17276
newY =
_ptCurrentCell
.Y - 1;
17279
newCurrentCell = new Point(
_ptCurrentCell
.X, newY);
17280
if (rowIndexDeleted ==
_ptCurrentCell
.Y)
17402
if (
_ptCurrentCell
.X == dataGridViewRow.Index &&
_ptCurrentCell
.Y == columnIndex)
17406
_ptCurrentCellCache.X =
_ptCurrentCell
.X;
17407
_ptCurrentCellCache.Y =
_ptCurrentCell
.Y;
17547
&&
_ptCurrentCell
.X == -1
17948
if (dataGridViewColumn is not null && hti._row !=
_ptCurrentCell
.Y)
17950
int oldCurrentCellX =
_ptCurrentCell
.X;
17951
int oldCurrentCellY =
_ptCurrentCell
.Y;
17958
fireRowLeave: hti._row !=
_ptCurrentCell
.Y,
17959
fireRowEnter: hti._row !=
_ptCurrentCell
.Y,
18011
if (
_ptCurrentCell
.X == -1 && lastVisibleRowIndex != -1)
18122
if (hti._row !=
_ptCurrentCell
.Y)
18140
else if (
_ptCurrentCell
.Y != -1)
18144
_ptCurrentCell
.X,
18145
_ptCurrentCell
.Y,
18402
if (
_ptCurrentCell
.Y != -1
18403
&& hti._row !=
_ptCurrentCell
.Y
18404
&& !CommitEditForOperation(
_ptCurrentCell
.X, hti._row, forCurrentCellChange: true))
18481
if (
_ptCurrentCell
.Y != -1 && hti._row !=
_ptCurrentCell
.Y)
18488
bool success = SetCurrentCellAddressCore(
_ptCurrentCell
.X,
18678
if (e.StateChanged == DataGridViewElementStates.ReadOnly && rowIndex ==
_ptCurrentCell
.Y && !_dataGridViewOper[OperationInReadOnlyChange])
18684
&& !Columns[
_ptCurrentCell
.X].ReadOnly
18685
&& ColumnEditable(
_ptCurrentCell
.X)
18698
if (
_ptCurrentCell
.X != -1 && dataGridViewRow.Index ==
_ptCurrentCell
.Y && EditingControl is not null)
18979
if (
_ptCurrentCell
.X != -1)
18983
_ptCurrentCell
.X,
18984
_ptCurrentCell
.Y,
19062
if (
_ptCurrentCell
.X >= 0)
19065
if (OnRowValidating(ref dataGridViewCellTmp,
_ptCurrentCell
.X,
_ptCurrentCell
.Y))
19072
if (
_ptCurrentCell
.X == -1)
19077
OnRowValidated(ref dataGridViewCellTmp,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
19080
if (DataSource is not null &&
_ptCurrentCell
.X >= 0 && AllowUserToAddRowsInternal && NewRowIndex ==
_ptCurrentCell
.Y)
19083
int rowIndex = Rows.GetPreviousRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
19087
_ptCurrentCell
.X,
19800
Debug.Assert(dataGridViewCell.ColumnIndex ==
_ptCurrentCell
.X);
19801
Debug.Assert(dataGridViewCell.RowIndex ==
_ptCurrentCell
.Y || dataGridViewCell.RowIndex == -1);
19814
int leftEdge = GetColumnXFromIndex(
_ptCurrentCell
.X);
19817
leftEdge -= Columns[
_ptCurrentCell
.X].Width - 1;
19820
Rectangle cellBounds = new(leftEdge, GetRowYFromIndex(
_ptCurrentCell
.Y),
19821
Columns[
_ptCurrentCell
.X].Width, Rows.SharedRow(
_ptCurrentCell
.Y).GetHeight(
_ptCurrentCell
.Y));
19824
if (!Columns[
_ptCurrentCell
.X].Frozen)
19835
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Frozen) == 0)
19860
bool isFirstDisplayedColumn = FirstDisplayedColumnIndex ==
_ptCurrentCell
.X;
19861
bool isFirstDisplayedRow = FirstDisplayedRowIndex ==
_ptCurrentCell
.Y;
20072
if (
_ptCurrentCell
.X > -1
20157
if (
_ptCurrentCell
.Y != -1)
20159
nextVisibleRowIndex = Rows.GetNextRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
20175
if (
_ptCurrentCell
.X == -1)
20201
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20207
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
20208
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
20209
if (
_ptCurrentCell
.X == -1 || _ptAnchorCell.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20222
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, false, false, false);
20230
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20235
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20242
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
20243
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20253
if (
_ptCurrentCell
.X == -1)
20273
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20278
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20285
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
20286
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20298
if (
_ptCurrentCell
.X == -1)
20324
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20329
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20337
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
20338
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
20356
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
20359
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, !MultiSelect, false, false);
20368
if (
_ptCurrentCell
.X == -1)
20394
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, forCurrentCellChange: true))
20399
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20406
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
20408
_ptCurrentCell
.X,
20428
if (
_ptCurrentCell
.X == -1)
20450
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20455
if (_ptAnchorCell.Y == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20464
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, false, false, false);
20472
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20477
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20483
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
20485
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20495
if (
_ptCurrentCell
.X == -1)
20515
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20520
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20528
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20540
if (
_ptCurrentCell
.X == -1)
20566
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20571
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20600
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, !MultiSelect, false, false);
20609
if (
_ptCurrentCell
.X == -1)
20635
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20640
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20648
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true, false, false);
20664
if (
_ptCurrentCell
.X == -1)
20686
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20692
if (_ptAnchorCell.Y == -1 ||
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20698
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
20705
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
20706
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
20716
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, false, false, false);
20724
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20729
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20735
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
20737
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
20742
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
20743
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
20746
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20756
if (
_ptCurrentCell
.X == -1)
20776
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20781
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20787
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
20795
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
20798
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20810
if (
_ptCurrentCell
.X == -1)
20836
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20841
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20847
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
20876
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
20877
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
20895
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
20899
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, !MultiSelect, false, false);
20908
if (
_ptCurrentCell
.X == -1)
20934
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20939
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20945
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
20953
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
20956
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true, false, false);
20970
if (
_ptCurrentCell
.X == -1)
20990
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20995
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
21001
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
21010
if (
_ptCurrentCell
.X == -1)
21036
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
21041
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
21047
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true, false, false);
21105
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21106
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21154
if (
_ptCurrentCell
.Y > -1
21155
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21158
SelectRowRange(
_ptCurrentCell
.Y, lastVisibleRowIndex, select: true);
21162
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21163
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21175
if (
_ptCurrentCell
.Y > -1
21176
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21192
if (
_ptCurrentCell
.Y > -1
21193
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21230
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
21269
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
21286
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
21288
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21289
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21324
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
21361
if (MultiSelect &&
_ptCurrentCell
.Y >= 0)
21416
if (
_ptCurrentCell
.X != -1)
21455
int columnIndex =
_ptCurrentCell
.X;
21456
int rowIndex =
_ptCurrentCell
.Y;
21498
if (
_ptCurrentCell
.X != -1 && !IsCurrentCellInEditMode && ModifierKeys == 0)
21500
Debug.Assert(
_ptCurrentCell
.Y != -1);
21503
|| IsSharedCellReadOnly(CurrentCellInternal,
_ptCurrentCell
.Y)
21504
|| !ColumnEditable(
_ptCurrentCell
.X));
21506
if (ColumnEditable(
_ptCurrentCell
.X)
21507
&& !IsSharedCellReadOnly(CurrentCellInternal,
_ptCurrentCell
.Y)
21510
bool success = ScrollIntoView(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, forCurrentCellChange: false);
21527
if (
_ptCurrentCell
.X != -1)
21529
DataGridViewColumn dataGridViewColumn = Columns[
_ptCurrentCell
.X];
21579
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21580
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21628
if (
_ptCurrentCell
.Y > -1
21629
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21636
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21637
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21649
if (
_ptCurrentCell
.Y > -1
21650
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21666
if (
_ptCurrentCell
.Y > -1
21667
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21704
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
21748
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
21765
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
21767
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21768
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21803
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
21875
if (
_ptCurrentCell
.X != -1)
21881
&& ColumnEditable(
_ptCurrentCell
.X)
21882
&& !IsSharedCellReadOnly(dataGridViewCell,
_ptCurrentCell
.Y)
21899
bool success = ScrollIntoView(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
22002
if ((keyData & Keys.Alt) == Keys.Alt && AllowUserToResizeColumns &&
_ptCurrentCell
.X != -1)
22006
DataGridViewColumn dataGridViewColumn = Columns[
_ptCurrentCell
.X];
22011
BeginKeyboardColumnResize(
_ptCurrentCell
.X);
22038
if (CurrentCell is null ||
_ptCurrentCell
.X == -1 ||
_ptCurrentCell
.Y == -1)
22080
if (
_ptCurrentCell
.X != -1)
22082
dataGridViewColumn = Columns.GetPreviousColumn(Columns[
_ptCurrentCell
.X],
22106
if (
_ptCurrentCell
.X == -1)
22127
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22132
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22140
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22141
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22158
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22161
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
22167
if (
_ptCurrentCell
.X == -1)
22188
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22193
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22199
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22200
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22217
if (
_ptCurrentCell
.X == -1)
22238
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22243
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22270
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
22276
if (
_ptCurrentCell
.X == -1)
22297
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22302
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22309
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22326
if (
_ptCurrentCell
.X == -1)
22347
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22352
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22357
if (Columns[
_ptCurrentCell
.X].Selected)
22383
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22384
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22401
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22405
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
22411
if (
_ptCurrentCell
.X == -1)
22432
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22437
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22442
if (Columns[
_ptCurrentCell
.X].Selected)
22450
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22453
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22468
if (
_ptCurrentCell
.X == -1)
22489
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22494
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22499
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22530
if (
_ptCurrentCell
.X == -1)
22548
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22554
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22555
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22556
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22570
_ptCurrentCell
.Y,
22578
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22583
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22589
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22592
_ptCurrentCell
.Y,
22602
if (
_ptCurrentCell
.X == -1)
22623
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, forCurrentCellChange: true))
22628
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22634
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, selected: true);
22637
_ptCurrentCell
.Y,
22650
if (
_ptCurrentCell
.X == -1)
22673
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22678
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22686
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
22691
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22696
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22701
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
22703
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22710
if (
_ptCurrentCell
.X == -1)
22726
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22731
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22738
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22748
if (
_ptCurrentCell
.X == -1)
22766
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22771
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22777
if (Columns[
_ptCurrentCell
.X].Selected)
22784
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22785
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22795
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
22800
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22805
if (
_ptCurrentCell
.X == -1 || IsInnerCellOutOfBounds(firstVisibleColumnIndex, firstVisibleRowIndex))
22810
if (Columns[
_ptCurrentCell
.X].Selected)
22812
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
22817
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
22818
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22821
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22828
if (
_ptCurrentCell
.X == -1)
22844
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22849
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22854
if (Columns[
_ptCurrentCell
.X].Selected)
22862
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22865
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22873
if (
_ptCurrentCell
.X == -1)
22889
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22894
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22899
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22928
if (
_ptCurrentCell
.Y == -1)
22938
nextScreenVisibleRowIndex =
_ptCurrentCell
.Y;
22947
if (!ScrollIntoView(
_ptCurrentCell
.X == -1 ? firstVisibleColumnIndex :
_ptCurrentCell
.X,
22954
_ptCurrentCell
.Y,
22985
if (
_ptCurrentCell
.X == -1)
23018
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23023
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23031
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23032
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23049
SetSelectedCellCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true);
23052
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, false, false, false);
23057
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23062
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23090
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, false, false, false);
23094
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23099
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23112
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23126
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23127
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23139
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23147
SetSelectedCellCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true);
23151
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, !MultiSelect, false, false);
23155
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23160
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23165
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true, false, false);
23189
if (
_ptCurrentCell
.Y == -1)
23199
previousScreenVisibleRowIndex =
_ptCurrentCell
.Y;
23229
_ptCurrentCell
.X == -1 ? firstVisibleColumnIndex :
_ptCurrentCell
.X,
23245
if (
_ptCurrentCell
.X == -1)
23277
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23282
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23290
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23291
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23308
SetSelectedCellCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true);
23311
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, false, false, false);
23315
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23320
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23348
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, false, false, false);
23352
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23357
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23370
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23384
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23385
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23397
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23405
SetSelectedCellCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true);
23409
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, !MultiSelect, false, false);
23413
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23418
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23423
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true, false, false);
23459
if (
_ptCurrentCell
.X != -1)
23461
dataGridViewColumn = Columns.GetNextColumn(Columns[
_ptCurrentCell
.X],
23485
if (
_ptCurrentCell
.X == -1)
23506
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23511
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23518
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23519
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23536
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23539
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
23545
if (
_ptCurrentCell
.X == -1)
23566
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23571
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23577
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23578
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23595
if (
_ptCurrentCell
.X == -1)
23616
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23621
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23648
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
23654
if (
_ptCurrentCell
.X == -1)
23675
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23680
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23687
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23704
if (
_ptCurrentCell
.X == -1)
23725
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23730
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23735
if (Columns[
_ptCurrentCell
.X].Selected)
23768
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23769
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23781
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23785
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
23791
if (
_ptCurrentCell
.X == -1)
23812
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23817
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23822
if (Columns[
_ptCurrentCell
.X].Selected)
23830
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23833
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23848
if (
_ptCurrentCell
.X == -1)
23869
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23874
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23879
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23910
if (
_ptCurrentCell
.X == -1)
23926
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23931
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
23944
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23945
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23953
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
23959
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23960
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23967
if (
_ptCurrentCell
.X == -1)
23983
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23988
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
23994
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23995
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24005
if (
_ptCurrentCell
.X == -1)
24021
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24026
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24041
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
24046
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
24048
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24055
if (
_ptCurrentCell
.X == -1)
24071
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24076
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24083
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24093
if (
_ptCurrentCell
.X == -1)
24109
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24114
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24127
if (Columns[
_ptCurrentCell
.X].Selected)
24134
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
24135
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24145
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
24150
if (Columns[
_ptCurrentCell
.X].Selected)
24152
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
24157
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
24158
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
24161
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24168
if (
_ptCurrentCell
.X == -1)
24184
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24189
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24194
if (Columns[
_ptCurrentCell
.X].Selected)
24202
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
24205
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24213
if (
_ptCurrentCell
.X == -1)
24229
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24234
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24239
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24256
if ((keyData & (Keys.Control | Keys.Shift | Keys.Alt)) == Keys.Shift &&
_ptCurrentCell
.X != -1)
24275
if (_selectedBandIndexes[bandIndex] !=
_ptCurrentCell
.X)
24287
if (!Columns[
_ptCurrentCell
.X].Selected)
24289
Debug.Assert(!_selectedBandIndexes.Contains(
_ptCurrentCell
.X));
24290
SetSelectedColumnCore(
_ptCurrentCell
.X, true);
24302
if (_selectedBandIndexes[bandIndex] !=
_ptCurrentCell
.Y)
24314
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) == 0)
24316
Debug.Assert(!_selectedBandIndexes.Contains(
_ptCurrentCell
.Y));
24317
SetSelectedRowCore(
_ptCurrentCell
.Y, true);
24539
if (
_ptCurrentCell
.Y != -1)
24541
previousVisibleRowIndex = Rows.GetPreviousRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
24555
if (
_ptCurrentCell
.X == -1)
24571
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24576
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24582
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
24583
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24591
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, false, false, false);
24595
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24600
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24606
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
24607
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
24613
if (
_ptCurrentCell
.X == -1)
24627
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24632
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24638
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
24639
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
24647
if (
_ptCurrentCell
.X == -1)
24666
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
24671
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24684
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
24685
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24697
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true);
24700
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, !MultiSelect, false, false);
24705
if (
_ptCurrentCell
.X == -1)
24724
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
24729
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24735
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, selected: true);
24737
_ptCurrentCell
.X,
24753
if (
_ptCurrentCell
.X == -1)
24769
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24774
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24782
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, false, false, false);
24786
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24791
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24796
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
24798
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
24804
if (
_ptCurrentCell
.X == -1)
24818
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24823
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24830
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
24838
if (
_ptCurrentCell
.X == -1)
24857
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
24862
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24889
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, !MultiSelect, false, false);
24894
if (
_ptCurrentCell
.X == -1)
24913
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
24918
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24925
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true, false, false);
24937
if (
_ptCurrentCell
.X == -1)
24953
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24958
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24964
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
24971
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
24972
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24982
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, false, false, false);
24986
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24991
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24996
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
24998
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
25003
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
25004
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
25007
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25013
if (
_ptCurrentCell
.X == -1)
25027
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
25032
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25037
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25045
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
25048
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25056
if (
_ptCurrentCell
.X == -1)
25075
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25080
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25085
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25111
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
25112
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
25129
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true);
25133
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, !MultiSelect, false, false);
25138
if (
_ptCurrentCell
.X == -1)
25157
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25162
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25167
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25175
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true);
25178
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true, false, false);
25188
if (
_ptCurrentCell
.X == -1)
25207
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, forCurrentCellChange: true))
25212
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25217
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25222
if (
_ptCurrentCell
.X == -1)
25241
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25246
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25251
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true, false, false);
25268
if (
_ptCurrentCell
.X != -1 && !IsCurrentCellInEditMode && ColumnEditable(
_ptCurrentCell
.X))
25273
if (!IsSharedCellReadOnly(dataGridViewCell,
_ptCurrentCell
.Y)
25277
bool success = ScrollIntoView(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
25290
object? nullValue = dataGridViewCurrentCell.GetInheritedStyle(inheritedCellStyle: null,
_ptCurrentCell
.Y, includeColors: false).NullValue;
25308
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
25349
_ptCurrentCell
.Y,
25350
_ptCurrentCell
.X,
25363
dataGridViewCurrentCell = Rows[
_ptCurrentCell
.Y].Cells[
_ptCurrentCell
.X];
25366
return dataGridViewCurrentCell.SetValueInternal(
_ptCurrentCell
.Y, dgvcpe.Value);
25388
dataGridViewCurrentCell = Rows[
_ptCurrentCell
.Y].Cells[
_ptCurrentCell
.X];
25391
return dataGridViewCurrentCell.SetValueInternal(
_ptCurrentCell
.Y, val);
25470
if (
_ptCurrentCell
.X != -1 && IsCurrentCellInEditMode)
25472
Debug.Assert(
_ptCurrentCell
.Y != -1);
25474
DataGridViewCellStyle dataGridViewCellStyle = dataGridViewCurrentCell.GetInheritedStyle(inheritedCellStyle: null,
_ptCurrentCell
.Y, includeColors: true);
26009
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26011
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26012
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26027
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26029
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26030
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26041
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26043
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26044
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26208
if (
_ptCurrentCell
.X >= 0 && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex))
26269
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26271
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26272
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26298
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26300
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26301
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26350
if (EditingControl is not null && (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Frozen) == 0)
26783
if (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex)
26788
_ptCurrentCell
.X = columnIndex;
26789
_ptCurrentCell
.Y = rowIndex;
26803
int oldCurrentCellX =
_ptCurrentCell
.X;
26804
int oldCurrentCellY =
_ptCurrentCell
.Y;
26849
Debug.Assert(oldCurrentCellX ==
_ptCurrentCell
.X);
26850
Debug.Assert(oldCurrentCellY ==
_ptCurrentCell
.Y);
26922
_ptCurrentCell
.X = columnIndex;
26923
_ptCurrentCell
.Y = rowIndex;
26944
OnCellEnter(ref dataGridViewCellTmp,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
26953
if (oldCurrentCellY !=
_ptCurrentCell
.Y && RowHeadersVisible && oldCurrentCellY < Rows.Count)
26959
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
26960
if (RowHeadersVisible && oldCurrentCellY !=
_ptCurrentCell
.Y)
26962
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
26966
&&
_ptCurrentCell
.X != -1
26984
if (
_ptCurrentCell
.X != -1)
26986
AccessibilityNotifyCurrentCellChanged(new Point(
_ptCurrentCell
.X,
_ptCurrentCell
.Y));
27013
int oldCurrentCellX =
_ptCurrentCell
.X;
27014
int oldCurrentCellY =
_ptCurrentCell
.Y;
27055
Debug.Assert(oldCurrentCellX ==
_ptCurrentCell
.X);
27056
Debug.Assert(oldCurrentCellY ==
_ptCurrentCell
.Y);
27080
if (
_ptCurrentCell
.X != -1)
27082
_ptCurrentCell
.X = -1;
27083
_ptCurrentCell
.Y = -1;
28220
_ptCurrentCellCache.X =
_ptCurrentCell
.X;
28221
_ptCurrentCellCache.Y =
_ptCurrentCell
.Y;
28496
if (
_ptCurrentCell
.X != -1)
28498
dataGridViewColumn = Columns.GetNextColumn(Columns[
_ptCurrentCell
.X],
28508
if (
_ptCurrentCell
.Y != -1)
28510
nextVisibleRowIndex = Rows.GetNextRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
28518
if (
_ptCurrentCell
.X == -1)
28531
targetRowIndex =
_ptCurrentCell
.Y;
28546
if (
_ptCurrentCell
.X == -1)
28569
if (
_ptCurrentCell
.X == -1)
28592
if (
_ptCurrentCell
.X == -1)
28603
if (targetRowIndex !=
_ptCurrentCell
.Y || MultiSelect)
28623
if (
_ptCurrentCell
.X == -1)
28657
if (
_ptCurrentCell
.X != -1)
28659
dataGridViewColumn = Columns.GetPreviousColumn(Columns[
_ptCurrentCell
.X],
28669
if (
_ptCurrentCell
.Y != -1)
28671
previousVisibleRowIndex = Rows.GetPreviousRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
28687
if (
_ptCurrentCell
.X == -1)
28700
targetRowIndex =
_ptCurrentCell
.Y;
28715
if (
_ptCurrentCell
.X == -1)
28738
if (
_ptCurrentCell
.X == -1)
28761
if (
_ptCurrentCell
.X == -1)
28772
if (targetRowIndex !=
_ptCurrentCell
.Y || MultiSelect)
28792
if (
_ptCurrentCell
.X == -1)
29098
PositionEditingControl(rowIndex == -1 ||
_ptCurrentCell
.Y != rowIndex, true, false);