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))
1708
if (
_ptCurrentCell
.X == -1 &&
_ptCurrentCell
.Y == -1)
1713
Debug.Assert(
_ptCurrentCell
.X >= 0 &&
_ptCurrentCell
.Y >= 0);
1714
Debug.Assert(
_ptCurrentCell
.X < Columns.Count);
1715
Debug.Assert(
_ptCurrentCell
.Y < Rows.Count);
1716
DataGridViewRow dataGridViewRow = Rows[
_ptCurrentCell
.Y]; // un-sharing row
1717
return dataGridViewRow.Cells[
_ptCurrentCell
.X];
1721
if ((value is not null && (value.RowIndex !=
_ptCurrentCell
.Y || value.ColumnIndex !=
_ptCurrentCell
.X))
1722
|| (value is null &&
_ptCurrentCell
.X != -1))
1776
public Point CurrentCellAddress =>
_ptCurrentCell
;
1782
Debug.Assert(
_ptCurrentCell
.X >= 0 &&
_ptCurrentCell
.X < Columns.Count);
1783
Debug.Assert(
_ptCurrentCell
.Y >= 0 &&
_ptCurrentCell
.Y < Rows.Count);
1784
DataGridViewRow dataGridViewRow = Rows.SharedRow(
_ptCurrentCell
.Y);
1786
DataGridViewCell dataGridViewCell = dataGridViewRow.Cells[
_ptCurrentCell
.X];
1787
Debug.Assert(IsSharedCellVisible(dataGridViewCell,
_ptCurrentCell
.Y));
1796
if (
_ptCurrentCell
.X == -1)
1801
Debug.Assert(
_ptCurrentCell
.Y != -1);
1803
bool previousVisibleColumnExists = (Columns.GetPreviousColumn(Columns[
_ptCurrentCell
.X], DataGridViewElementStates.Visible, DataGridViewElementStates.None) is not null);
1804
bool previousVisibleRowExists = (Rows.GetPreviousRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible) != -1);
1814
if (
_ptCurrentCell
.X == -1)
1819
Debug.Assert(
_ptCurrentCell
.Y != -1);
1821
bool nextVisibleColumnExists = (Columns.GetNextColumn(Columns[
_ptCurrentCell
.X], DataGridViewElementStates.Visible, DataGridViewElementStates.None) is not null);
1822
bool nextVisibleRowExists = (Rows.GetNextRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible) != -1);
1832
if (
_ptCurrentCell
.X == -1)
1837
Debug.Assert(
_ptCurrentCell
.Y != -1);
1850
if (
_ptCurrentCell
.X == -1)
1855
Debug.Assert(
_ptCurrentCell
.Y >= 0);
1856
Debug.Assert(
_ptCurrentCell
.Y < Rows.Count);
1858
return Rows[
_ptCurrentCell
.Y];
2488
if (
_ptCurrentCell
.X >= 0
2568
if (
_ptCurrentCell
.X >= 0
2745
&& !Columns[
_ptCurrentCell
.X].Frozen
2850
=>
_ptCurrentCell
.X == -1 ? null : CurrentCellInternal.GetInheritedStyleInternal(
_ptCurrentCell
.Y);
2901
if (RowHeadersVisible && ShowEditingIcon &&
_ptCurrentCell
.Y >= 0)
2904
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
3071
if (value &&
_ptCurrentCell
.X != -1 && IsCurrentCellInEditMode)
3143
if (
_ptCurrentCell
.X != -1 && !SetCurrentCellAddressCore(
3895
Debug.Assert(
_ptCurrentCell
.Y >= 0);
3896
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
3903
Debug.Assert(
_ptCurrentCell
.Y >= 0);
3904
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)))
16507
if (
_ptCurrentCell
.X >= 0 && !CommitEdit(
16550
if (
_ptCurrentCell
.X >= 0 && !CommitEdit(
16859
&&
_ptCurrentCell
.X != -1
16860
&& ColumnEditable(
_ptCurrentCell
.X)
16864
&& !Rows[
_ptCurrentCell
.Y].Cells[
_ptCurrentCell
.X].ReadOnly) // Un-shares the row
16899
Debug.Assert(
_ptCurrentCell
.X == -1);
16950
Debug.Assert(
_ptCurrentCell
.X == -1);
17032
if (
_ptCurrentCell
.X != -1)
17034
int newX =
_ptCurrentCell
.X;
17035
if (columnIndex ==
_ptCurrentCell
.X)
17062
else if (columnIndex <
_ptCurrentCell
.X)
17064
newX =
_ptCurrentCell
.X - 1;
17067
newCurrentCell = new Point(newX, (newX == -1) ? -1 :
_ptCurrentCell
.Y);
17068
if (columnIndex ==
_ptCurrentCell
.X)
17254
if (
_ptCurrentCell
.Y != -1 && rowIndexDeleted <=
_ptCurrentCell
.Y)
17257
if (rowIndexDeleted ==
_ptCurrentCell
.Y)
17278
Debug.Assert(rowIndexDeleted <
_ptCurrentCell
.Y);
17279
newY =
_ptCurrentCell
.Y - 1;
17282
newCurrentCell = new Point(
_ptCurrentCell
.X, newY);
17283
if (rowIndexDeleted ==
_ptCurrentCell
.Y)
17405
if (
_ptCurrentCell
.X == dataGridViewRow.Index &&
_ptCurrentCell
.Y == columnIndex)
17409
_ptCurrentCellCache.X =
_ptCurrentCell
.X;
17410
_ptCurrentCellCache.Y =
_ptCurrentCell
.Y;
17550
&&
_ptCurrentCell
.X == -1
17951
if (dataGridViewColumn is not null && hti._row !=
_ptCurrentCell
.Y)
17953
int oldCurrentCellX =
_ptCurrentCell
.X;
17954
int oldCurrentCellY =
_ptCurrentCell
.Y;
17961
fireRowLeave: hti._row !=
_ptCurrentCell
.Y,
17962
fireRowEnter: hti._row !=
_ptCurrentCell
.Y,
18014
if (
_ptCurrentCell
.X == -1 && lastVisibleRowIndex != -1)
18125
if (hti._row !=
_ptCurrentCell
.Y)
18143
else if (
_ptCurrentCell
.Y != -1)
18147
_ptCurrentCell
.X,
18148
_ptCurrentCell
.Y,
18405
if (
_ptCurrentCell
.Y != -1
18406
&& hti._row !=
_ptCurrentCell
.Y
18407
&& !CommitEditForOperation(
_ptCurrentCell
.X, hti._row, forCurrentCellChange: true))
18484
if (
_ptCurrentCell
.Y != -1 && hti._row !=
_ptCurrentCell
.Y)
18491
bool success = SetCurrentCellAddressCore(
_ptCurrentCell
.X,
18681
if (e.StateChanged == DataGridViewElementStates.ReadOnly && rowIndex ==
_ptCurrentCell
.Y && !_dataGridViewOper[OperationInReadOnlyChange])
18687
&& !Columns[
_ptCurrentCell
.X].ReadOnly
18688
&& ColumnEditable(
_ptCurrentCell
.X)
18701
if (
_ptCurrentCell
.X != -1 && dataGridViewRow.Index ==
_ptCurrentCell
.Y && EditingControl is not null)
18982
if (
_ptCurrentCell
.X != -1)
18986
_ptCurrentCell
.X,
18987
_ptCurrentCell
.Y,
19065
if (
_ptCurrentCell
.X >= 0)
19068
if (OnRowValidating(ref dataGridViewCellTmp,
_ptCurrentCell
.X,
_ptCurrentCell
.Y))
19075
if (
_ptCurrentCell
.X == -1)
19080
OnRowValidated(ref dataGridViewCellTmp,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
19083
if (DataSource is not null &&
_ptCurrentCell
.X >= 0 && AllowUserToAddRowsInternal && NewRowIndex ==
_ptCurrentCell
.Y)
19086
int rowIndex = Rows.GetPreviousRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
19090
_ptCurrentCell
.X,
19803
Debug.Assert(dataGridViewCell.ColumnIndex ==
_ptCurrentCell
.X);
19804
Debug.Assert(dataGridViewCell.RowIndex ==
_ptCurrentCell
.Y || dataGridViewCell.RowIndex == -1);
19817
int leftEdge = GetColumnXFromIndex(
_ptCurrentCell
.X);
19820
leftEdge -= Columns[
_ptCurrentCell
.X].Width - 1;
19823
Rectangle cellBounds = new(leftEdge, GetRowYFromIndex(
_ptCurrentCell
.Y),
19824
Columns[
_ptCurrentCell
.X].Width, Rows.SharedRow(
_ptCurrentCell
.Y).GetHeight(
_ptCurrentCell
.Y));
19827
if (!Columns[
_ptCurrentCell
.X].Frozen)
19838
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Frozen) == 0)
19863
bool isFirstDisplayedColumn = FirstDisplayedColumnIndex ==
_ptCurrentCell
.X;
19864
bool isFirstDisplayedRow = FirstDisplayedRowIndex ==
_ptCurrentCell
.Y;
20075
if (
_ptCurrentCell
.X > -1
20160
if (
_ptCurrentCell
.Y != -1)
20162
nextVisibleRowIndex = Rows.GetNextRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
20178
if (
_ptCurrentCell
.X == -1)
20204
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20210
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
20211
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
20212
if (
_ptCurrentCell
.X == -1 || _ptAnchorCell.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20225
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, false, false, false);
20233
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20238
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20245
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
20246
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20256
if (
_ptCurrentCell
.X == -1)
20276
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20281
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20288
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
20289
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20301
if (
_ptCurrentCell
.X == -1)
20327
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20332
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20340
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
20341
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
20359
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
20362
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, !MultiSelect, false, false);
20371
if (
_ptCurrentCell
.X == -1)
20397
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, forCurrentCellChange: true))
20402
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20409
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
20411
_ptCurrentCell
.X,
20431
if (
_ptCurrentCell
.X == -1)
20453
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20458
if (_ptAnchorCell.Y == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20467
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, false, false, false);
20475
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20480
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20486
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
20488
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20498
if (
_ptCurrentCell
.X == -1)
20518
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20523
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20531
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20543
if (
_ptCurrentCell
.X == -1)
20569
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20574
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20603
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, !MultiSelect, false, false);
20612
if (
_ptCurrentCell
.X == -1)
20638
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20643
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20651
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true, false, false);
20667
if (
_ptCurrentCell
.X == -1)
20689
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20695
if (_ptAnchorCell.Y == -1 ||
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20701
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
20708
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
20709
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
20719
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, false, false, false);
20727
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20732
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20738
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
20740
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
20745
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
20746
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
20749
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20759
if (
_ptCurrentCell
.X == -1)
20779
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20784
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20790
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
20798
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
20801
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20813
if (
_ptCurrentCell
.X == -1)
20839
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20844
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20850
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
20879
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
20880
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
20898
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
20902
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, !MultiSelect, false, false);
20911
if (
_ptCurrentCell
.X == -1)
20937
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20942
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20948
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
20956
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
20959
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true, false, false);
20973
if (
_ptCurrentCell
.X == -1)
20993
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20998
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
21004
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
21013
if (
_ptCurrentCell
.X == -1)
21039
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
21044
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
21050
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true, false, false);
21108
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21109
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21157
if (
_ptCurrentCell
.Y > -1
21158
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21161
SelectRowRange(
_ptCurrentCell
.Y, lastVisibleRowIndex, select: true);
21165
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21166
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21178
if (
_ptCurrentCell
.Y > -1
21179
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21195
if (
_ptCurrentCell
.Y > -1
21196
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21233
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
21272
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
21289
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
21291
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21292
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21327
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
21364
if (MultiSelect &&
_ptCurrentCell
.Y >= 0)
21419
if (
_ptCurrentCell
.X != -1)
21458
int columnIndex =
_ptCurrentCell
.X;
21459
int rowIndex =
_ptCurrentCell
.Y;
21501
if (
_ptCurrentCell
.X != -1 && !IsCurrentCellInEditMode && ModifierKeys == 0)
21503
Debug.Assert(
_ptCurrentCell
.Y != -1);
21506
|| IsSharedCellReadOnly(CurrentCellInternal,
_ptCurrentCell
.Y)
21507
|| !ColumnEditable(
_ptCurrentCell
.X));
21509
if (ColumnEditable(
_ptCurrentCell
.X)
21510
&& !IsSharedCellReadOnly(CurrentCellInternal,
_ptCurrentCell
.Y)
21513
bool success = ScrollIntoView(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, forCurrentCellChange: false);
21530
if (
_ptCurrentCell
.X != -1)
21532
DataGridViewColumn dataGridViewColumn = Columns[
_ptCurrentCell
.X];
21582
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21583
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21631
if (
_ptCurrentCell
.Y > -1
21632
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21639
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21640
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21652
if (
_ptCurrentCell
.Y > -1
21653
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21669
if (
_ptCurrentCell
.Y > -1
21670
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21707
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
21751
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
21768
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
21770
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21771
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21806
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
21878
if (
_ptCurrentCell
.X != -1)
21884
&& ColumnEditable(
_ptCurrentCell
.X)
21885
&& !IsSharedCellReadOnly(dataGridViewCell,
_ptCurrentCell
.Y)
21902
bool success = ScrollIntoView(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
22005
if ((keyData & Keys.Alt) == Keys.Alt && AllowUserToResizeColumns &&
_ptCurrentCell
.X != -1)
22009
DataGridViewColumn dataGridViewColumn = Columns[
_ptCurrentCell
.X];
22014
BeginKeyboardColumnResize(
_ptCurrentCell
.X);
22041
if (CurrentCell is null ||
_ptCurrentCell
.X == -1 ||
_ptCurrentCell
.Y == -1)
22083
if (
_ptCurrentCell
.X != -1)
22085
dataGridViewColumn = Columns.GetPreviousColumn(Columns[
_ptCurrentCell
.X],
22109
if (
_ptCurrentCell
.X == -1)
22130
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22135
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22143
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22144
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22161
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22164
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
22170
if (
_ptCurrentCell
.X == -1)
22191
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22196
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22202
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22203
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22220
if (
_ptCurrentCell
.X == -1)
22241
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22246
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22273
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
22279
if (
_ptCurrentCell
.X == -1)
22300
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22305
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22312
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22329
if (
_ptCurrentCell
.X == -1)
22350
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22355
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22360
if (Columns[
_ptCurrentCell
.X].Selected)
22386
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22387
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22404
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22408
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
22414
if (
_ptCurrentCell
.X == -1)
22435
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22440
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22445
if (Columns[
_ptCurrentCell
.X].Selected)
22453
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22456
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22471
if (
_ptCurrentCell
.X == -1)
22492
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22497
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22502
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22533
if (
_ptCurrentCell
.X == -1)
22551
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22557
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22558
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22559
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22573
_ptCurrentCell
.Y,
22581
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22586
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22592
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22595
_ptCurrentCell
.Y,
22605
if (
_ptCurrentCell
.X == -1)
22626
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, forCurrentCellChange: true))
22631
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22637
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, selected: true);
22640
_ptCurrentCell
.Y,
22653
if (
_ptCurrentCell
.X == -1)
22676
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22681
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22689
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
22694
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22699
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22704
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
22706
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22713
if (
_ptCurrentCell
.X == -1)
22729
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22734
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22741
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22751
if (
_ptCurrentCell
.X == -1)
22769
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22774
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22780
if (Columns[
_ptCurrentCell
.X].Selected)
22787
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22788
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22798
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
22803
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22808
if (
_ptCurrentCell
.X == -1 || IsInnerCellOutOfBounds(firstVisibleColumnIndex, firstVisibleRowIndex))
22813
if (Columns[
_ptCurrentCell
.X].Selected)
22815
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
22820
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
22821
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22824
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22831
if (
_ptCurrentCell
.X == -1)
22847
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22852
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22857
if (Columns[
_ptCurrentCell
.X].Selected)
22865
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22868
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22876
if (
_ptCurrentCell
.X == -1)
22892
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22897
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
22902
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22931
if (
_ptCurrentCell
.Y == -1)
22941
nextScreenVisibleRowIndex =
_ptCurrentCell
.Y;
22950
if (!ScrollIntoView(
_ptCurrentCell
.X == -1 ? firstVisibleColumnIndex :
_ptCurrentCell
.X,
22957
_ptCurrentCell
.Y,
22988
if (
_ptCurrentCell
.X == -1)
23021
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23026
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23034
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23035
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23052
SetSelectedCellCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true);
23055
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, false, false, false);
23060
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23065
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23093
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, false, false, false);
23097
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23102
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23115
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23129
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23130
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23142
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23150
SetSelectedCellCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true);
23154
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, !MultiSelect, false, false);
23158
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23163
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23168
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true, false, false);
23192
if (
_ptCurrentCell
.Y == -1)
23202
previousScreenVisibleRowIndex =
_ptCurrentCell
.Y;
23232
_ptCurrentCell
.X == -1 ? firstVisibleColumnIndex :
_ptCurrentCell
.X,
23248
if (
_ptCurrentCell
.X == -1)
23280
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23285
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23293
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23294
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23311
SetSelectedCellCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true);
23314
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, false, false, false);
23318
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23323
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23351
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, false, false, false);
23355
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23360
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23373
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23387
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23388
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23400
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23408
SetSelectedCellCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true);
23412
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, !MultiSelect, false, false);
23416
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23421
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23426
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true, false, false);
23462
if (
_ptCurrentCell
.X != -1)
23464
dataGridViewColumn = Columns.GetNextColumn(Columns[
_ptCurrentCell
.X],
23488
if (
_ptCurrentCell
.X == -1)
23509
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23514
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23521
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23522
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23539
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23542
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
23548
if (
_ptCurrentCell
.X == -1)
23569
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23574
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23580
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23581
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23598
if (
_ptCurrentCell
.X == -1)
23619
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23624
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23651
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
23657
if (
_ptCurrentCell
.X == -1)
23678
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23683
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23690
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23707
if (
_ptCurrentCell
.X == -1)
23728
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23733
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23738
if (Columns[
_ptCurrentCell
.X].Selected)
23771
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23772
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23784
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23788
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
23794
if (
_ptCurrentCell
.X == -1)
23815
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23820
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23825
if (Columns[
_ptCurrentCell
.X].Selected)
23833
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23836
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23851
if (
_ptCurrentCell
.X == -1)
23872
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23877
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23882
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23913
if (
_ptCurrentCell
.X == -1)
23929
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23934
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
23947
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23948
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23956
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
23962
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23963
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23970
if (
_ptCurrentCell
.X == -1)
23986
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23991
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
23997
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23998
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24008
if (
_ptCurrentCell
.X == -1)
24024
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24029
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24044
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
24049
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
24051
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24058
if (
_ptCurrentCell
.X == -1)
24074
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24079
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24086
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24096
if (
_ptCurrentCell
.X == -1)
24112
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24117
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24130
if (Columns[
_ptCurrentCell
.X].Selected)
24137
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
24138
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24148
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
24153
if (Columns[
_ptCurrentCell
.X].Selected)
24155
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
24160
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
24161
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
24164
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24171
if (
_ptCurrentCell
.X == -1)
24187
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24192
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24197
if (Columns[
_ptCurrentCell
.X].Selected)
24205
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
24208
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24216
if (
_ptCurrentCell
.X == -1)
24232
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24237
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24242
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24259
if ((keyData & (Keys.Control | Keys.Shift | Keys.Alt)) == Keys.Shift &&
_ptCurrentCell
.X != -1)
24278
if (_selectedBandIndexes[bandIndex] !=
_ptCurrentCell
.X)
24290
if (!Columns[
_ptCurrentCell
.X].Selected)
24292
Debug.Assert(!_selectedBandIndexes.Contains(
_ptCurrentCell
.X));
24293
SetSelectedColumnCore(
_ptCurrentCell
.X, true);
24305
if (_selectedBandIndexes[bandIndex] !=
_ptCurrentCell
.Y)
24317
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) == 0)
24319
Debug.Assert(!_selectedBandIndexes.Contains(
_ptCurrentCell
.Y));
24320
SetSelectedRowCore(
_ptCurrentCell
.Y, true);
24542
if (
_ptCurrentCell
.Y != -1)
24544
previousVisibleRowIndex = Rows.GetPreviousRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
24558
if (
_ptCurrentCell
.X == -1)
24574
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24579
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24585
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
24586
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24594
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, false, false, false);
24598
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24603
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24609
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
24610
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
24616
if (
_ptCurrentCell
.X == -1)
24630
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24635
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24641
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
24642
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
24650
if (
_ptCurrentCell
.X == -1)
24669
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
24674
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24687
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
24688
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24700
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true);
24703
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, !MultiSelect, false, false);
24708
if (
_ptCurrentCell
.X == -1)
24727
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
24732
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24738
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, selected: true);
24740
_ptCurrentCell
.X,
24756
if (
_ptCurrentCell
.X == -1)
24772
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24777
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24785
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, false, false, false);
24789
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24794
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24799
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
24801
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
24807
if (
_ptCurrentCell
.X == -1)
24821
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24826
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24833
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
24841
if (
_ptCurrentCell
.X == -1)
24860
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
24865
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24892
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, !MultiSelect, false, false);
24897
if (
_ptCurrentCell
.X == -1)
24916
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
24921
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
24928
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true, false, false);
24940
if (
_ptCurrentCell
.X == -1)
24956
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24961
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24967
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
24974
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
24975
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24985
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, false, false, false);
24989
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
24994
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
24999
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25001
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
25006
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
25007
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
25010
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25016
if (
_ptCurrentCell
.X == -1)
25030
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
25035
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25040
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25048
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
25051
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25059
if (
_ptCurrentCell
.X == -1)
25078
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25083
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25088
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25114
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
25115
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
25132
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true);
25136
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, !MultiSelect, false, false);
25141
if (
_ptCurrentCell
.X == -1)
25160
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25165
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25170
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25178
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true);
25181
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true, false, false);
25191
if (
_ptCurrentCell
.X == -1)
25210
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, forCurrentCellChange: true))
25215
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25220
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25225
if (
_ptCurrentCell
.X == -1)
25244
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25249
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25254
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true, false, false);
25271
if (
_ptCurrentCell
.X != -1 && !IsCurrentCellInEditMode && ColumnEditable(
_ptCurrentCell
.X))
25276
if (!IsSharedCellReadOnly(dataGridViewCell,
_ptCurrentCell
.Y)
25280
bool success = ScrollIntoView(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
25293
object? nullValue = dataGridViewCurrentCell.GetInheritedStyle(inheritedCellStyle: null,
_ptCurrentCell
.Y, includeColors: false).NullValue;
25311
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
25352
_ptCurrentCell
.Y,
25353
_ptCurrentCell
.X,
25366
dataGridViewCurrentCell = Rows[
_ptCurrentCell
.Y].Cells[
_ptCurrentCell
.X];
25369
return dataGridViewCurrentCell.SetValueInternal(
_ptCurrentCell
.Y, dgvcpe.Value);
25391
dataGridViewCurrentCell = Rows[
_ptCurrentCell
.Y].Cells[
_ptCurrentCell
.X];
25394
return dataGridViewCurrentCell.SetValueInternal(
_ptCurrentCell
.Y, val);
25473
if (
_ptCurrentCell
.X != -1 && IsCurrentCellInEditMode)
25475
Debug.Assert(
_ptCurrentCell
.Y != -1);
25477
DataGridViewCellStyle dataGridViewCellStyle = dataGridViewCurrentCell.GetInheritedStyle(inheritedCellStyle: null,
_ptCurrentCell
.Y, includeColors: true);
26012
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26014
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26015
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26030
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26032
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26033
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26044
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26046
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26047
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26211
if (
_ptCurrentCell
.X >= 0 && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex))
26272
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26274
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26275
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26301
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26303
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26304
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26353
if (EditingControl is not null && (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Frozen) == 0)
26786
if (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex)
26791
_ptCurrentCell
.X = columnIndex;
26792
_ptCurrentCell
.Y = rowIndex;
26806
int oldCurrentCellX =
_ptCurrentCell
.X;
26807
int oldCurrentCellY =
_ptCurrentCell
.Y;
26852
Debug.Assert(oldCurrentCellX ==
_ptCurrentCell
.X);
26853
Debug.Assert(oldCurrentCellY ==
_ptCurrentCell
.Y);
26925
_ptCurrentCell
.X = columnIndex;
26926
_ptCurrentCell
.Y = rowIndex;
26947
OnCellEnter(ref dataGridViewCellTmp,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
26956
if (oldCurrentCellY !=
_ptCurrentCell
.Y && RowHeadersVisible && oldCurrentCellY < Rows.Count)
26962
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
26963
if (RowHeadersVisible && oldCurrentCellY !=
_ptCurrentCell
.Y)
26965
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
26969
&&
_ptCurrentCell
.X != -1
26987
if (
_ptCurrentCell
.X != -1)
26989
AccessibilityNotifyCurrentCellChanged(new Point(
_ptCurrentCell
.X,
_ptCurrentCell
.Y));
27016
int oldCurrentCellX =
_ptCurrentCell
.X;
27017
int oldCurrentCellY =
_ptCurrentCell
.Y;
27058
Debug.Assert(oldCurrentCellX ==
_ptCurrentCell
.X);
27059
Debug.Assert(oldCurrentCellY ==
_ptCurrentCell
.Y);
27083
if (
_ptCurrentCell
.X != -1)
27085
_ptCurrentCell
.X = -1;
27086
_ptCurrentCell
.Y = -1;
28223
_ptCurrentCellCache.X =
_ptCurrentCell
.X;
28224
_ptCurrentCellCache.Y =
_ptCurrentCell
.Y;
28499
if (
_ptCurrentCell
.X != -1)
28501
dataGridViewColumn = Columns.GetNextColumn(Columns[
_ptCurrentCell
.X],
28511
if (
_ptCurrentCell
.Y != -1)
28513
nextVisibleRowIndex = Rows.GetNextRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
28521
if (
_ptCurrentCell
.X == -1)
28534
targetRowIndex =
_ptCurrentCell
.Y;
28549
if (
_ptCurrentCell
.X == -1)
28572
if (
_ptCurrentCell
.X == -1)
28595
if (
_ptCurrentCell
.X == -1)
28606
if (targetRowIndex !=
_ptCurrentCell
.Y || MultiSelect)
28626
if (
_ptCurrentCell
.X == -1)
28660
if (
_ptCurrentCell
.X != -1)
28662
dataGridViewColumn = Columns.GetPreviousColumn(Columns[
_ptCurrentCell
.X],
28672
if (
_ptCurrentCell
.Y != -1)
28674
previousVisibleRowIndex = Rows.GetPreviousRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
28690
if (
_ptCurrentCell
.X == -1)
28703
targetRowIndex =
_ptCurrentCell
.Y;
28718
if (
_ptCurrentCell
.X == -1)
28741
if (
_ptCurrentCell
.X == -1)
28764
if (
_ptCurrentCell
.X == -1)
28775
if (targetRowIndex !=
_ptCurrentCell
.Y || MultiSelect)
28795
if (
_ptCurrentCell
.X == -1)
29101
PositionEditingControl(rowIndex == -1 ||
_ptCurrentCell
.Y != rowIndex, true, false);