1 write to _ptCurrentCell
System.Windows.Forms (1)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
475
_ptCurrentCell
= new Point(-1, -1);
944 references to _ptCurrentCell
System.Windows.Forms (944)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (49)
1135
if (
_ptCurrentCell
.X != -1 && ColumnEditable(
_ptCurrentCell
.X))
1140
if (!IsSharedCellReadOnly(dataGridViewCell,
_ptCurrentCell
.Y))
1701
if (
_ptCurrentCell
.X == -1 &&
_ptCurrentCell
.Y == -1)
1706
Debug.Assert(
_ptCurrentCell
.X >= 0 &&
_ptCurrentCell
.Y >= 0);
1707
Debug.Assert(
_ptCurrentCell
.X < Columns.Count);
1708
Debug.Assert(
_ptCurrentCell
.Y < Rows.Count);
1709
DataGridViewRow dataGridViewRow = Rows[
_ptCurrentCell
.Y]; // un-sharing row
1710
return dataGridViewRow.Cells[
_ptCurrentCell
.X];
1714
if ((value is not null && (value.RowIndex !=
_ptCurrentCell
.Y || value.ColumnIndex !=
_ptCurrentCell
.X))
1715
|| (value is null &&
_ptCurrentCell
.X != -1))
1769
public Point CurrentCellAddress =>
_ptCurrentCell
;
1775
Debug.Assert(
_ptCurrentCell
.X >= 0 &&
_ptCurrentCell
.X < Columns.Count);
1776
Debug.Assert(
_ptCurrentCell
.Y >= 0 &&
_ptCurrentCell
.Y < Rows.Count);
1777
DataGridViewRow dataGridViewRow = Rows.SharedRow(
_ptCurrentCell
.Y);
1779
DataGridViewCell dataGridViewCell = dataGridViewRow.Cells[
_ptCurrentCell
.X];
1780
Debug.Assert(IsSharedCellVisible(dataGridViewCell,
_ptCurrentCell
.Y));
1789
if (
_ptCurrentCell
.X == -1)
1794
Debug.Assert(
_ptCurrentCell
.Y != -1);
1796
bool previousVisibleColumnExists = (Columns.GetPreviousColumn(Columns[
_ptCurrentCell
.X], DataGridViewElementStates.Visible, DataGridViewElementStates.None) is not null);
1797
bool previousVisibleRowExists = (Rows.GetPreviousRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible) != -1);
1807
if (
_ptCurrentCell
.X == -1)
1812
Debug.Assert(
_ptCurrentCell
.Y != -1);
1814
bool nextVisibleColumnExists = (Columns.GetNextColumn(Columns[
_ptCurrentCell
.X], DataGridViewElementStates.Visible, DataGridViewElementStates.None) is not null);
1815
bool nextVisibleRowExists = (Rows.GetNextRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible) != -1);
1825
if (
_ptCurrentCell
.X == -1)
1830
Debug.Assert(
_ptCurrentCell
.Y != -1);
1843
if (
_ptCurrentCell
.X == -1)
1848
Debug.Assert(
_ptCurrentCell
.Y >= 0);
1849
Debug.Assert(
_ptCurrentCell
.Y < Rows.Count);
1851
return Rows[
_ptCurrentCell
.Y];
2480
if (
_ptCurrentCell
.X >= 0
2560
if (
_ptCurrentCell
.X >= 0
2737
&& !Columns[
_ptCurrentCell
.X].Frozen
2842
=>
_ptCurrentCell
.X == -1 ? null : CurrentCellInternal.GetInheritedStyleInternal(
_ptCurrentCell
.Y);
2893
if (RowHeadersVisible && ShowEditingIcon &&
_ptCurrentCell
.Y >= 0)
2896
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
3063
if (value &&
_ptCurrentCell
.X != -1 && IsCurrentCellInEditMode)
3135
if (
_ptCurrentCell
.X != -1 && !SetCurrentCellAddressCore(
3887
Debug.Assert(
_ptCurrentCell
.Y >= 0);
3888
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
3895
Debug.Assert(
_ptCurrentCell
.Y >= 0);
3896
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);
2685
((IDataGridViewEditingControl)EditingControl).EditingControlRowIndex =
_ptCurrentCell
.Y;
2705
if (_toolTipControl.Activated && _ptToolTipCell ==
_ptCurrentCell
)
2722
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3041
if (
_ptCurrentCell
.X != -1)
3043
Debug.Assert(
_ptCurrentCell
.Y != -1);
3045
int oldCurrentCellX =
_ptCurrentCell
.X;
3103
_ptCurrentCell
.X,
3104
_ptCurrentCell
.Y,
3129
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3133
else if (
_ptCurrentCell
.X == -1 && Focused)
3203
int oldCurrentCellX =
_ptCurrentCell
.X;
3208
if (currentCellDirty ||
_ptCurrentCell
.Y == -1 ||
_ptCurrentCell
.X == -1)
3236
if (
_ptCurrentCell
.Y > -1)
3238
InvalidateRowPrivate(
_ptCurrentCell
.Y);
3242
DataGridViewCellStyle dataGridViewCellStyle = dataGridViewCell.GetInheritedStyle(inheritedCellStyle: null,
_ptCurrentCell
.Y, includeColors: true);
3259
if (discardNewRow &&
_ptCurrentCell
.Y == NewRowIndex - 1)
3267
if (!IsCurrentRowDirty &&
_ptCurrentCell
.Y == NewRowIndex - 1 && _dataGridViewState1[State1_NewRowCreatedByEditing])
3307
if (
_ptCurrentCell
.X > -1)
3353
if ((DataConnection.CurrencyManager?.Count ?? 0) <=
_ptCurrentCell
.Y)
3422
if (
_ptCurrentCell
.X != -1 && SelectionMode == DataGridViewSelectionMode.FullRowSelect)
3424
InvalidateCellPrivate(
_ptCurrentCell
.X, -1);
3760
Debug.Assert(
_ptCurrentCell
.X > -1);
3763
if (
_ptCurrentCell
.X == -1)
3768
OnCellLeave(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3773
if (
_ptCurrentCell
.X == -1)
3778
OnRowLeave(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3789
if (
_ptCurrentCell
.X > -1 &&
_ptCurrentCell
.Y > -1)
3791
InvalidateCellPrivate(columnIndex:
_ptCurrentCell
.X, rowIndex:
_ptCurrentCell
.Y);
3799
if (
_ptCurrentCell
.X == -1)
3804
if (OnCellValidating(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y, context))
3808
if (
_ptCurrentCell
.X == -1)
3815
_ptCurrentCell
.X,
3816
_ptCurrentCell
.Y,
3823
if (
_ptCurrentCell
.X == -1)
3828
OnCellEnter(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3831
if (
_ptCurrentCell
.X == -1)
3838
_ptCurrentCell
.X,
3839
_ptCurrentCell
.Y,
3849
if (
_ptCurrentCell
.X == -1)
3854
OnCellValidated(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3859
if (
_ptCurrentCell
.X == -1 || !IsCurrentCellInEditMode)
3875
Debug.Assert(
_ptCurrentCell
.X > -1);
3876
if (
_ptCurrentCell
.X == -1)
3881
if (OnCellValidating(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y, context))
3883
if (
_ptCurrentCell
.X == -1)
3890
_ptCurrentCell
.X,
3891
_ptCurrentCell
.Y,
3915
if (
_ptCurrentCell
.X == -1)
3922
_ptCurrentCell
.X,
3923
_ptCurrentCell
.Y,
3957
if (
_ptCurrentCell
.X == -1)
3962
OnCellValidated(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
4022
Debug.Assert(
_ptCurrentCell
.X > -1);
4023
if (
_ptCurrentCell
.X == -1)
4028
int columnIndex =
_ptCurrentCell
.X;
4029
int rowIndex =
_ptCurrentCell
.Y;
4073
fireRowLeave:
_ptCurrentCell
.Y != rowIndex,
4074
fireRowEnter:
_ptCurrentCell
.Y != rowIndex,
4083
if (
_ptCurrentCell
.Y != rowIndex &&
_ptCurrentCell
.Y != -1)
4086
int columnIndexTmp =
_ptCurrentCell
.X;
4087
int rowIndexTmp =
_ptCurrentCell
.Y;
4138
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
4158
if (forCurrentCellChange &&
_ptCurrentCell
.X == -1 && lastVisibleRowIndex != -1)
5477
Debug.Assert(
_ptCurrentCell
.Y == NewRowIndex);
5737
Debug.Assert(
_ptCurrentCell
.X != -1);
5950
Debug.Assert(
_ptCurrentCell
.X != -1);
5960
Debug.Assert(
_ptCurrentCell
.X != -1);
6162
if (
_ptCurrentCell
.X == -1)
6170
int curRowIndex =
_ptCurrentCell
.Y;
6171
int curColIndex =
_ptCurrentCell
.X;
6215
if (curRowIndex !=
_ptCurrentCell
.Y || curColIndex !=
_ptCurrentCell
.X)
6239
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
6266
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
8818
|| (
_ptCurrentCell
.Y != -1 && (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Frozen) == 0))
8870
if (((_ptAnchorCell.X != -1 && !Columns[_ptAnchorCell.X].Frozen) || (
_ptCurrentCell
.X != -1 && !Columns[
_ptCurrentCell
.X].Frozen))
9686
_uneditedFormattedValue = dataGridViewCell.GetFormattedValue(
_ptCurrentCell
.Y, ref dataGridViewCellStyle, DataGridViewDataErrorContexts.Formatting);
9696
Debug.Assert(
_ptCurrentCell
.X == dataGridViewCell.ColumnIndex);
9697
dataGridViewCell = Rows[
_ptCurrentCell
.Y].Cells[
_ptCurrentCell
.X]; // un-share the edited cell
9707
_ptCurrentCell
.X,
9708
_ptCurrentCell
.Y,
9727
object? initialFormattedValue = dataGridViewCell.GetFormattedValue(
_ptCurrentCell
.Y, ref dataGridViewCellStyle, DataGridViewDataErrorContexts.Formatting);
9732
dataGridViewCell.InitializeEditingControl(
_ptCurrentCell
.Y, initialFormattedValue, dataGridViewCellStyle);
9739
_ptCurrentCell
.X,
9740
_ptCurrentCell
.Y,
10110
&&
_ptCurrentCell
.X != -1)
12051
if (
_ptCurrentCell
.X == -1)
12068
if (
_ptCurrentCell
.X >= 0 && (
_ptCurrentCell
.X != hti._col ||
_ptCurrentCell
.Y != hti._row))
12070
Point ptOriginalCurrentCell =
_ptCurrentCell
;
12073
forCurrentCellChange:
_ptCurrentCell
.X != hti._col ||
_ptCurrentCell
.Y != hti._row,
12074
forCurrentRowChange:
_ptCurrentCell
.Y != hti._row))
12080
if (
_ptCurrentCell
!= ptOriginalCurrentCell)
12093
if (
_ptCurrentCell
.X == -1 && dataGridViewLastVisibleColumn is not null)
12109
if (
_ptCurrentCell
.X == -1 && lastVisibleRowIndex != -1)
12155
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
12156
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
12345
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
12346
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
12551
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
12552
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
12765
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
12766
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
12767
if ((hti._col !=
_ptCurrentCell
.X || hti._row !=
_ptCurrentCell
.Y)
12790
if (hti._col !=
_ptCurrentCell
.X || hti._row !=
_ptCurrentCell
.Y)
12824
&&
_ptCurrentCell
.X == dataGridViewCell.ColumnIndex
12825
&&
_ptCurrentCell
.Y == dataGridViewCell.RowIndex
12832
&& ColumnEditable(
_ptCurrentCell
.X)
13700
if (rowIndex > -1 && hti._col !=
_ptCurrentCell
.X)
13703
int oldCurrentCellX =
_ptCurrentCell
.X;
13704
int oldCurrentCellY =
_ptCurrentCell
.Y;
13710
fireRowLeave: rowIndex !=
_ptCurrentCell
.Y,
13711
fireRowEnter: rowIndex !=
_ptCurrentCell
.Y,
13842
if (hti._col !=
_ptCurrentCell
.X)
13864
else if (
_ptCurrentCell
.X != -1)
13868
_ptCurrentCell
.X,
13869
_ptCurrentCell
.Y,
14129
if (
_ptCurrentCell
.X != -1 && hti._col !=
_ptCurrentCell
.X && !CommitEditForOperation(hti._col,
_ptCurrentCell
.Y, true))
14211
if (
_ptCurrentCell
.X != -1 && hti._col !=
_ptCurrentCell
.X)
14213
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(hti._col))
14220
_ptCurrentCell
.Y,
14439
&& dataGridViewColumn.Index ==
_ptCurrentCell
.X
14445
&& ColumnEditable(
_ptCurrentCell
.X)
14446
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.ReadOnly) == 0
14522
PositionEditingControl(
_ptCurrentCell
.X != e.Column.Index, true, false);
14550
|| (columnIndex ==
_ptCurrentCell
.X && rowIndex ==
_ptCurrentCell
.Y))))
14581
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
14584
if (IsCurrentCellDirty && NewRowIndex ==
_ptCurrentCell
.Y)
14725
else if (dataGridViewColumn.Visible &&
_ptCurrentCell
.X == dataGridViewColumn.Index)
14746
if (
_ptCurrentCell
.X == dataGridViewColumn.Index
14786
if (elementState == DataGridViewElementStates.Visible &&
_ptCurrentCell
.Y == rowIndex)
14794
Debug.Assert(DataConnection.CurrencyManager.Position ==
_ptCurrentCell
.Y);
14808
if (
_ptCurrentCell
.Y == rowIndex
14846
if (
_ptCurrentCell
.X == dataGridViewCell.ColumnIndex
14847
&&
_ptCurrentCell
.Y == dataGridViewCell.RowIndex
14963
if (Focused && EditMode == DataGridViewEditMode.EditOnEnter &&
_ptCurrentCell
.X > -1 && !IsCurrentCellInEditMode)
15016
if (
_ptCurrentCell
.X > -1)
15024
_ptCurrentCell
.X,
15025
_ptCurrentCell
.Y,
15028
if (
_ptCurrentCell
.X == -1)
15033
OnCellEnter(ref dataGridViewCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
15038
InvalidateCellPrivate(
_ptCurrentCell
.X, -1);
15047
if (
_ptCurrentCell
.X > -1 && !IsCurrentCellInEditMode)
15053
if (
_ptCurrentCell
.X > -1 && CurrentCellInternal.EditType is null && !_dataGridViewOper[OperationInMouseDown])
15058
InvalidateCellPrivate(columnIndex:
_ptCurrentCell
.X, rowIndex:
_ptCurrentCell
.Y);
15067
InvalidateCellPrivate(columnIndex:
_ptCurrentCell
.X, rowIndex:
_ptCurrentCell
.Y);
15190
if (
_ptCurrentCell
.X != -1)
15192
InvalidateCell(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
15199
&&
_ptCurrentCell
.X > -1)
15204
AccessibilityNotifyCurrentCellChanged(
_ptCurrentCell
);
15232
if (
_ptCurrentCell
.X == -1)
15238
ScrollIntoView(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, forCurrentCellChange: false);
15274
Debug.Assert(
_ptCurrentCell
.X == -1);
15312
Debug.Assert(
_ptCurrentCell
.X == -1);
15352
Debug.Assert(
_ptCurrentCell
.X == -1);
15411
if (
_ptCurrentCell
.X != -1)
15413
newCurrentCell = new Point(columnIndexInserted <=
_ptCurrentCell
.X ?
_ptCurrentCell
.X + 1 :
_ptCurrentCell
.X,
15414
_ptCurrentCell
.Y);
15531
if (
_ptCurrentCell
.Y != -1 && rowIndexInserted <=
_ptCurrentCell
.Y)
15533
newCurrentCell = new Point(
_ptCurrentCell
.X,
_ptCurrentCell
.Y + insertionCount);
15614
if (
_ptCurrentCell
.Y != -1 && rowIndexInserted <=
_ptCurrentCell
.Y)
15616
newCurrentCell = new Point(
_ptCurrentCell
.X,
_ptCurrentCell
.Y + dataGridViewRows.Length);
15679
if (
_ptCurrentCell
.X != -1)
15683
if (dataGridViewCell.KeyDownUnsharesRowInternal(e,
_ptCurrentCell
.Y))
15686
_ = Rows[
_ptCurrentCell
.Y];
15687
CurrentCellInternal.OnKeyDownInternal(e,
_ptCurrentCell
.Y);
15691
dataGridViewCell.OnKeyDownInternal(e,
_ptCurrentCell
.Y);
15738
if (
_ptCurrentCell
.X != -1)
15742
if (dataGridViewCell.KeyPressUnsharesRowInternal(e,
_ptCurrentCell
.Y))
15745
_ = Rows[
_ptCurrentCell
.Y];
15746
CurrentCellInternal.OnKeyPressInternal(e,
_ptCurrentCell
.Y);
15750
dataGridViewCell.OnKeyPressInternal(e,
_ptCurrentCell
.Y);
15772
if (
_ptCurrentCell
.X != -1)
15776
if (dataGridViewCell.KeyUpUnsharesRowInternal(e,
_ptCurrentCell
.Y))
15779
_ = Rows[
_ptCurrentCell
.Y];
15780
CurrentCellInternal.OnKeyUpInternal(e,
_ptCurrentCell
.Y);
15784
dataGridViewCell.OnKeyUpInternal(e,
_ptCurrentCell
.Y);
15815
if (
_ptCurrentCell
.X > -1 && !_dataGridViewState1[State1_LeavingWithTabKey])
15818
OnCellLeave(ref dataGridViewCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
15819
if (
_ptCurrentCell
.X == -1)
15824
OnRowLeave(ref dataGridViewCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
15832
if (
_ptCurrentCell
.X > -1 &&
_ptCurrentCell
.Y > -1)
15834
InvalidateCellPrivate(columnIndex:
_ptCurrentCell
.X, rowIndex:
_ptCurrentCell
.Y);
15848
if (
_ptCurrentCell
.X != -1)
15850
InvalidateCell(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
15878
|| (_ptMouseDownCell.X ==
_ptCurrentCell
.X && _ptMouseDownCell.Y ==
_ptCurrentCell
.Y)))
16510
if (
_ptCurrentCell
.X >= 0 && !CommitEdit(
16553
if (
_ptCurrentCell
.X >= 0 && !CommitEdit(
16862
&&
_ptCurrentCell
.X != -1
16863
&& ColumnEditable(
_ptCurrentCell
.X)
16867
&& !Rows[
_ptCurrentCell
.Y].Cells[
_ptCurrentCell
.X].ReadOnly) // Un-shares the row
16902
Debug.Assert(
_ptCurrentCell
.X == -1);
16953
Debug.Assert(
_ptCurrentCell
.X == -1);
17035
if (
_ptCurrentCell
.X != -1)
17037
int newX =
_ptCurrentCell
.X;
17038
if (columnIndex ==
_ptCurrentCell
.X)
17065
else if (columnIndex <
_ptCurrentCell
.X)
17067
newX =
_ptCurrentCell
.X - 1;
17070
newCurrentCell = new Point(newX, (newX == -1) ? -1 :
_ptCurrentCell
.Y);
17071
if (columnIndex ==
_ptCurrentCell
.X)
17257
if (
_ptCurrentCell
.Y != -1 && rowIndexDeleted <=
_ptCurrentCell
.Y)
17260
if (rowIndexDeleted ==
_ptCurrentCell
.Y)
17281
Debug.Assert(rowIndexDeleted <
_ptCurrentCell
.Y);
17282
newY =
_ptCurrentCell
.Y - 1;
17285
newCurrentCell = new Point(
_ptCurrentCell
.X, newY);
17286
if (rowIndexDeleted ==
_ptCurrentCell
.Y)
17408
if (
_ptCurrentCell
.X == dataGridViewRow.Index &&
_ptCurrentCell
.Y == columnIndex)
17412
_ptCurrentCellCache.X =
_ptCurrentCell
.X;
17413
_ptCurrentCellCache.Y =
_ptCurrentCell
.Y;
17553
&&
_ptCurrentCell
.X == -1
17954
if (dataGridViewColumn is not null && hti._row !=
_ptCurrentCell
.Y)
17956
int oldCurrentCellX =
_ptCurrentCell
.X;
17957
int oldCurrentCellY =
_ptCurrentCell
.Y;
17964
fireRowLeave: hti._row !=
_ptCurrentCell
.Y,
17965
fireRowEnter: hti._row !=
_ptCurrentCell
.Y,
18017
if (
_ptCurrentCell
.X == -1 && lastVisibleRowIndex != -1)
18128
if (hti._row !=
_ptCurrentCell
.Y)
18146
else if (
_ptCurrentCell
.Y != -1)
18150
_ptCurrentCell
.X,
18151
_ptCurrentCell
.Y,
18408
if (
_ptCurrentCell
.Y != -1
18409
&& hti._row !=
_ptCurrentCell
.Y
18410
&& !CommitEditForOperation(
_ptCurrentCell
.X, hti._row, forCurrentCellChange: true))
18487
if (
_ptCurrentCell
.Y != -1 && hti._row !=
_ptCurrentCell
.Y)
18494
bool success = SetCurrentCellAddressCore(
_ptCurrentCell
.X,
18684
if (e.StateChanged == DataGridViewElementStates.ReadOnly && rowIndex ==
_ptCurrentCell
.Y && !_dataGridViewOper[OperationInReadOnlyChange])
18690
&& !Columns[
_ptCurrentCell
.X].ReadOnly
18691
&& ColumnEditable(
_ptCurrentCell
.X)
18704
if (
_ptCurrentCell
.X != -1 && dataGridViewRow.Index ==
_ptCurrentCell
.Y && EditingControl is not null)
18985
if (
_ptCurrentCell
.X != -1)
18989
_ptCurrentCell
.X,
18990
_ptCurrentCell
.Y,
19068
if (
_ptCurrentCell
.X >= 0)
19071
if (OnRowValidating(ref dataGridViewCellTmp,
_ptCurrentCell
.X,
_ptCurrentCell
.Y))
19078
if (
_ptCurrentCell
.X == -1)
19083
OnRowValidated(ref dataGridViewCellTmp,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
19086
if (DataSource is not null &&
_ptCurrentCell
.X >= 0 && AllowUserToAddRowsInternal && NewRowIndex ==
_ptCurrentCell
.Y)
19089
int rowIndex = Rows.GetPreviousRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
19093
_ptCurrentCell
.X,
19809
Debug.Assert(dataGridViewCell.ColumnIndex ==
_ptCurrentCell
.X);
19810
Debug.Assert(dataGridViewCell.RowIndex ==
_ptCurrentCell
.Y || dataGridViewCell.RowIndex == -1);
19823
int leftEdge = GetColumnXFromIndex(
_ptCurrentCell
.X);
19826
leftEdge -= Columns[
_ptCurrentCell
.X].Width - 1;
19829
Rectangle cellBounds = new(leftEdge, GetRowYFromIndex(
_ptCurrentCell
.Y),
19830
Columns[
_ptCurrentCell
.X].Width, Rows.SharedRow(
_ptCurrentCell
.Y).GetHeight(
_ptCurrentCell
.Y));
19833
if (!Columns[
_ptCurrentCell
.X].Frozen)
19844
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Frozen) == 0)
19869
bool isFirstDisplayedColumn = FirstDisplayedColumnIndex ==
_ptCurrentCell
.X;
19870
bool isFirstDisplayedRow = FirstDisplayedRowIndex ==
_ptCurrentCell
.Y;
20081
if (
_ptCurrentCell
.X > -1
20166
if (
_ptCurrentCell
.Y != -1)
20168
nextVisibleRowIndex = Rows.GetNextRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
20184
if (
_ptCurrentCell
.X == -1)
20210
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20216
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
20217
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
20218
if (
_ptCurrentCell
.X == -1 || _ptAnchorCell.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20231
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, false, false, false);
20239
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20244
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20251
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
20252
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20262
if (
_ptCurrentCell
.X == -1)
20282
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20287
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20294
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
20295
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20307
if (
_ptCurrentCell
.X == -1)
20333
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20338
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20346
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
20347
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
20365
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
20368
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, !MultiSelect, false, false);
20377
if (
_ptCurrentCell
.X == -1)
20403
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, forCurrentCellChange: true))
20408
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20415
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
20417
_ptCurrentCell
.X,
20437
if (
_ptCurrentCell
.X == -1)
20459
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20464
if (_ptAnchorCell.Y == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20473
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, false, false, false);
20481
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20486
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20492
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
20494
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20504
if (
_ptCurrentCell
.X == -1)
20524
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20529
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20537
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20549
if (
_ptCurrentCell
.X == -1)
20575
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20580
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20609
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, !MultiSelect, false, false);
20618
if (
_ptCurrentCell
.X == -1)
20644
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20649
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20657
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true, false, false);
20673
if (
_ptCurrentCell
.X == -1)
20695
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20701
if (_ptAnchorCell.Y == -1 ||
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20707
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
20714
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
20715
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
20725
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, false, false, false);
20733
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20738
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20744
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
20746
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
20751
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
20752
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
20755
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20765
if (
_ptCurrentCell
.X == -1)
20785
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20790
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20796
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
20804
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
20807
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20819
if (
_ptCurrentCell
.X == -1)
20845
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20850
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20856
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
20885
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
20886
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
20904
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
20908
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, !MultiSelect, false, false);
20917
if (
_ptCurrentCell
.X == -1)
20943
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20948
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20954
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
20962
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
20965
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true, false, false);
20979
if (
_ptCurrentCell
.X == -1)
20999
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
21004
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
21010
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
21019
if (
_ptCurrentCell
.X == -1)
21045
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
21050
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
21056
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true, false, false);
21114
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21115
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21163
if (
_ptCurrentCell
.Y > -1
21164
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21167
SelectRowRange(
_ptCurrentCell
.Y, lastVisibleRowIndex, select: true);
21171
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21172
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21184
if (
_ptCurrentCell
.Y > -1
21185
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21201
if (
_ptCurrentCell
.Y > -1
21202
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21239
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
21278
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
21295
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
21297
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21298
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21333
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
21370
if (MultiSelect &&
_ptCurrentCell
.Y >= 0)
21425
if (
_ptCurrentCell
.X != -1)
21464
int columnIndex =
_ptCurrentCell
.X;
21465
int rowIndex =
_ptCurrentCell
.Y;
21507
if (
_ptCurrentCell
.X != -1 && !IsCurrentCellInEditMode && ModifierKeys == 0)
21509
Debug.Assert(
_ptCurrentCell
.Y != -1);
21512
|| IsSharedCellReadOnly(CurrentCellInternal,
_ptCurrentCell
.Y)
21513
|| !ColumnEditable(
_ptCurrentCell
.X));
21515
if (ColumnEditable(
_ptCurrentCell
.X)
21516
&& !IsSharedCellReadOnly(CurrentCellInternal,
_ptCurrentCell
.Y)
21519
bool success = ScrollIntoView(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, forCurrentCellChange: false);
21536
if (
_ptCurrentCell
.X != -1)
21538
DataGridViewColumn dataGridViewColumn = Columns[
_ptCurrentCell
.X];
21588
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21589
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21637
if (
_ptCurrentCell
.Y > -1
21638
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21645
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21646
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21658
if (
_ptCurrentCell
.Y > -1
21659
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21675
if (
_ptCurrentCell
.Y > -1
21676
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21713
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
21757
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
21774
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
21776
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21777
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21812
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
21884
if (
_ptCurrentCell
.X != -1)
21890
&& ColumnEditable(
_ptCurrentCell
.X)
21891
&& !IsSharedCellReadOnly(dataGridViewCell,
_ptCurrentCell
.Y)
21908
bool success = ScrollIntoView(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
22011
if ((keyData & Keys.Alt) == Keys.Alt && AllowUserToResizeColumns &&
_ptCurrentCell
.X != -1)
22015
DataGridViewColumn dataGridViewColumn = Columns[
_ptCurrentCell
.X];
22020
BeginKeyboardColumnResize(
_ptCurrentCell
.X);
22047
if (CurrentCell is null ||
_ptCurrentCell
.X == -1 ||
_ptCurrentCell
.Y == -1)
22089
if (
_ptCurrentCell
.X != -1)
22091
dataGridViewColumn = Columns.GetPreviousColumn(Columns[
_ptCurrentCell
.X],
22115
if (
_ptCurrentCell
.X == -1)
22136
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22141
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22149
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22150
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22167
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22170
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
22176
if (
_ptCurrentCell
.X == -1)
22197
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22202
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22208
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22209
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22226
if (
_ptCurrentCell
.X == -1)
22247
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22252
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22279
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
22285
if (
_ptCurrentCell
.X == -1)
22306
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22311
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22318
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22335
if (
_ptCurrentCell
.X == -1)
22356
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22361
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22366
if (Columns[
_ptCurrentCell
.X].Selected)
22392
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22393
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22410
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22414
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
22420
if (
_ptCurrentCell
.X == -1)
22441
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22446
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22451
if (Columns[
_ptCurrentCell
.X].Selected)
22459
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22462
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22477
if (
_ptCurrentCell
.X == -1)
22498
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22503
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22508
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22539
if (
_ptCurrentCell
.X == -1)
22557
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22563
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22564
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22565
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22579
_ptCurrentCell
.Y,
22587
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22592
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22598
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22601
_ptCurrentCell
.Y,
22611
if (
_ptCurrentCell
.X == -1)
22632
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, forCurrentCellChange: true))
22637
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22643
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, selected: true);
22646
_ptCurrentCell
.Y,
22659
if (
_ptCurrentCell
.X == -1)
22682
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22687
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22695
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
22700
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22705
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22710
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
22712
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22719
if (
_ptCurrentCell
.X == -1)
22735
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22740
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22747
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22757
if (
_ptCurrentCell
.X == -1)
22775
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22780
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22786
if (Columns[
_ptCurrentCell
.X].Selected)
22793
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22794
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22804
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
22809
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22814
if (
_ptCurrentCell
.X == -1 || IsInnerCellOutOfBounds(firstVisibleColumnIndex, firstVisibleRowIndex))
22819
if (Columns[
_ptCurrentCell
.X].Selected)
22821
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
22826
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
22827
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22830
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22837
if (
_ptCurrentCell
.X == -1)
22853
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22858
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22863
if (Columns[
_ptCurrentCell
.X].Selected)
22871
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22874
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22882
if (
_ptCurrentCell
.X == -1)
22898
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22903
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22908
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22937
if (
_ptCurrentCell
.Y == -1)
22947
nextScreenVisibleRowIndex =
_ptCurrentCell
.Y;
22956
if (!ScrollIntoView(
_ptCurrentCell
.X == -1 ? firstVisibleColumnIndex :
_ptCurrentCell
.X,
22963
_ptCurrentCell
.Y,
22994
if (
_ptCurrentCell
.X == -1)
23027
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23032
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23040
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23041
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23058
SetSelectedCellCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true);
23061
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, false, false, false);
23066
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23071
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23099
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, false, false, false);
23103
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23108
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23121
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23135
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23136
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23148
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23156
SetSelectedCellCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true);
23160
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, !MultiSelect, false, false);
23164
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23169
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23174
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true, false, false);
23198
if (
_ptCurrentCell
.Y == -1)
23208
previousScreenVisibleRowIndex =
_ptCurrentCell
.Y;
23238
_ptCurrentCell
.X == -1 ? firstVisibleColumnIndex :
_ptCurrentCell
.X,
23254
if (
_ptCurrentCell
.X == -1)
23286
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23291
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23299
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23300
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23317
SetSelectedCellCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true);
23320
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, false, false, false);
23324
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23329
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23357
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, false, false, false);
23361
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23366
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23379
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23393
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23394
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23406
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23414
SetSelectedCellCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true);
23418
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, !MultiSelect, false, false);
23422
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23427
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23432
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true, false, false);
23468
if (
_ptCurrentCell
.X != -1)
23470
dataGridViewColumn = Columns.GetNextColumn(Columns[
_ptCurrentCell
.X],
23494
if (
_ptCurrentCell
.X == -1)
23515
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23520
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23527
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23528
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23545
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23548
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
23554
if (
_ptCurrentCell
.X == -1)
23575
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23580
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23586
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23587
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23604
if (
_ptCurrentCell
.X == -1)
23625
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23630
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23657
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
23663
if (
_ptCurrentCell
.X == -1)
23684
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23689
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23696
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23713
if (
_ptCurrentCell
.X == -1)
23734
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23739
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23744
if (Columns[
_ptCurrentCell
.X].Selected)
23777
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23778
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23790
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23794
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
23800
if (
_ptCurrentCell
.X == -1)
23821
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23826
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23831
if (Columns[
_ptCurrentCell
.X].Selected)
23839
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23842
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23857
if (
_ptCurrentCell
.X == -1)
23878
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23883
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23888
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23919
if (
_ptCurrentCell
.X == -1)
23935
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23940
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
23953
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23954
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23962
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
23968
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23969
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23976
if (
_ptCurrentCell
.X == -1)
23992
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23997
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24003
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
24004
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24014
if (
_ptCurrentCell
.X == -1)
24030
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24035
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24050
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
24055
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
24057
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24064
if (
_ptCurrentCell
.X == -1)
24080
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24085
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24092
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24102
if (
_ptCurrentCell
.X == -1)
24118
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24123
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24136
if (Columns[
_ptCurrentCell
.X].Selected)
24143
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
24144
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24154
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
24159
if (Columns[
_ptCurrentCell
.X].Selected)
24161
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
24166
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
24167
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
24170
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24177
if (
_ptCurrentCell
.X == -1)
24193
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24198
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24203
if (Columns[
_ptCurrentCell
.X].Selected)
24211
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
24214
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24222
if (
_ptCurrentCell
.X == -1)
24238
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24243
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24248
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24265
if ((keyData & (Keys.Control | Keys.Shift | Keys.Alt)) == Keys.Shift &&
_ptCurrentCell
.X != -1)
24284
if (_selectedBandIndexes[bandIndex] !=
_ptCurrentCell
.X)
24296
if (!Columns[
_ptCurrentCell
.X].Selected)
24298
Debug.Assert(!_selectedBandIndexes.Contains(
_ptCurrentCell
.X));
24299
SetSelectedColumnCore(
_ptCurrentCell
.X, true);
24311
if (_selectedBandIndexes[bandIndex] !=
_ptCurrentCell
.Y)
24323
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) == 0)
24325
Debug.Assert(!_selectedBandIndexes.Contains(
_ptCurrentCell
.Y));
24326
SetSelectedRowCore(
_ptCurrentCell
.Y, true);
24548
if (
_ptCurrentCell
.Y != -1)
24550
previousVisibleRowIndex = Rows.GetPreviousRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
24564
if (
_ptCurrentCell
.X == -1)
24580
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24585
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24591
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
24592
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24600
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, false, false, false);
24604
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24609
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24615
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
24616
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
24622
if (
_ptCurrentCell
.X == -1)
24636
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24641
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24647
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
24648
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
24656
if (
_ptCurrentCell
.X == -1)
24675
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
24680
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24693
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
24694
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24706
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true);
24709
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, !MultiSelect, false, false);
24714
if (
_ptCurrentCell
.X == -1)
24733
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
24738
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24744
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, selected: true);
24746
_ptCurrentCell
.X,
24762
if (
_ptCurrentCell
.X == -1)
24778
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24783
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24791
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, false, false, false);
24795
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24800
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24805
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
24807
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
24813
if (
_ptCurrentCell
.X == -1)
24827
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24832
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24839
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
24847
if (
_ptCurrentCell
.X == -1)
24866
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
24871
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24898
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, !MultiSelect, false, false);
24903
if (
_ptCurrentCell
.X == -1)
24922
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
24927
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24934
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true, false, false);
24946
if (
_ptCurrentCell
.X == -1)
24962
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24967
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24973
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
24980
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
24981
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24991
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, false, false, false);
24995
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
25000
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25005
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25007
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
25012
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
25013
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
25016
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25022
if (
_ptCurrentCell
.X == -1)
25036
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
25041
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25046
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25054
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
25057
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25065
if (
_ptCurrentCell
.X == -1)
25084
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25089
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25094
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25120
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
25121
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
25138
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true);
25142
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, !MultiSelect, false, false);
25147
if (
_ptCurrentCell
.X == -1)
25166
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25171
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25176
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25184
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true);
25187
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true, false, false);
25197
if (
_ptCurrentCell
.X == -1)
25216
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, forCurrentCellChange: true))
25221
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25226
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25231
if (
_ptCurrentCell
.X == -1)
25250
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25255
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25260
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true, false, false);
25277
if (
_ptCurrentCell
.X != -1 && !IsCurrentCellInEditMode && ColumnEditable(
_ptCurrentCell
.X))
25282
if (!IsSharedCellReadOnly(dataGridViewCell,
_ptCurrentCell
.Y)
25286
bool success = ScrollIntoView(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
25299
object? nullValue = dataGridViewCurrentCell.GetInheritedStyle(inheritedCellStyle: null,
_ptCurrentCell
.Y, includeColors: false).NullValue;
25317
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
25358
_ptCurrentCell
.Y,
25359
_ptCurrentCell
.X,
25372
dataGridViewCurrentCell = Rows[
_ptCurrentCell
.Y].Cells[
_ptCurrentCell
.X];
25375
return dataGridViewCurrentCell.SetValueInternal(
_ptCurrentCell
.Y, dgvcpe.Value);
25397
dataGridViewCurrentCell = Rows[
_ptCurrentCell
.Y].Cells[
_ptCurrentCell
.X];
25400
return dataGridViewCurrentCell.SetValueInternal(
_ptCurrentCell
.Y, val);
25479
if (
_ptCurrentCell
.X != -1 && IsCurrentCellInEditMode)
25481
Debug.Assert(
_ptCurrentCell
.Y != -1);
25483
DataGridViewCellStyle dataGridViewCellStyle = dataGridViewCurrentCell.GetInheritedStyle(inheritedCellStyle: null,
_ptCurrentCell
.Y, includeColors: true);
26018
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26020
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26021
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26036
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26038
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26039
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26050
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26052
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26053
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26217
if (
_ptCurrentCell
.X >= 0 && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex))
26278
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26280
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26281
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26307
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26309
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26310
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26359
if (EditingControl is not null && (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Frozen) == 0)
26792
if (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex)
26797
_ptCurrentCell
.X = columnIndex;
26798
_ptCurrentCell
.Y = rowIndex;
26812
int oldCurrentCellX =
_ptCurrentCell
.X;
26813
int oldCurrentCellY =
_ptCurrentCell
.Y;
26858
Debug.Assert(oldCurrentCellX ==
_ptCurrentCell
.X);
26859
Debug.Assert(oldCurrentCellY ==
_ptCurrentCell
.Y);
26931
_ptCurrentCell
.X = columnIndex;
26932
_ptCurrentCell
.Y = rowIndex;
26953
OnCellEnter(ref dataGridViewCellTmp,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
26962
if (oldCurrentCellY !=
_ptCurrentCell
.Y && RowHeadersVisible && oldCurrentCellY < Rows.Count)
26968
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
26969
if (RowHeadersVisible && oldCurrentCellY !=
_ptCurrentCell
.Y)
26971
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
26975
&&
_ptCurrentCell
.X != -1
26993
if (
_ptCurrentCell
.X != -1)
26995
AccessibilityNotifyCurrentCellChanged(new Point(
_ptCurrentCell
.X,
_ptCurrentCell
.Y));
27022
int oldCurrentCellX =
_ptCurrentCell
.X;
27023
int oldCurrentCellY =
_ptCurrentCell
.Y;
27063
Debug.Assert(oldCurrentCellX ==
_ptCurrentCell
.X);
27064
Debug.Assert(oldCurrentCellY ==
_ptCurrentCell
.Y);
27088
if (
_ptCurrentCell
.X != -1)
27090
_ptCurrentCell
.X = -1;
27091
_ptCurrentCell
.Y = -1;
28228
_ptCurrentCellCache.X =
_ptCurrentCell
.X;
28229
_ptCurrentCellCache.Y =
_ptCurrentCell
.Y;
28504
if (
_ptCurrentCell
.X != -1)
28506
dataGridViewColumn = Columns.GetNextColumn(Columns[
_ptCurrentCell
.X],
28516
if (
_ptCurrentCell
.Y != -1)
28518
nextVisibleRowIndex = Rows.GetNextRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
28526
if (
_ptCurrentCell
.X == -1)
28539
targetRowIndex =
_ptCurrentCell
.Y;
28554
if (
_ptCurrentCell
.X == -1)
28577
if (
_ptCurrentCell
.X == -1)
28600
if (
_ptCurrentCell
.X == -1)
28611
if (targetRowIndex !=
_ptCurrentCell
.Y || MultiSelect)
28631
if (
_ptCurrentCell
.X == -1)
28665
if (
_ptCurrentCell
.X != -1)
28667
dataGridViewColumn = Columns.GetPreviousColumn(Columns[
_ptCurrentCell
.X],
28677
if (
_ptCurrentCell
.Y != -1)
28679
previousVisibleRowIndex = Rows.GetPreviousRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
28695
if (
_ptCurrentCell
.X == -1)
28708
targetRowIndex =
_ptCurrentCell
.Y;
28723
if (
_ptCurrentCell
.X == -1)
28746
if (
_ptCurrentCell
.X == -1)
28769
if (
_ptCurrentCell
.X == -1)
28780
if (targetRowIndex !=
_ptCurrentCell
.Y || MultiSelect)
28800
if (
_ptCurrentCell
.X == -1)
29106
PositionEditingControl(rowIndex == -1 ||
_ptCurrentCell
.Y != rowIndex, true, false);