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);
3065
if (value &&
_ptCurrentCell
.X != -1 && IsCurrentCellInEditMode)
3137
if (
_ptCurrentCell
.X != -1 && !SetCurrentCellAddressCore(
3889
Debug.Assert(
_ptCurrentCell
.Y >= 0);
3890
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
3897
Debug.Assert(
_ptCurrentCell
.Y >= 0);
3898
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (895)
2668
if (
_ptCurrentCell
.X == -1)
2691
Debug.Assert(
_ptCurrentCell
.X >= 0 &&
_ptCurrentCell
.X < Columns.Count);
2692
Debug.Assert(
_ptCurrentCell
.Y >= 0 &&
_ptCurrentCell
.Y < Rows.Count);
2698
if (IsSharedCellReadOnly(dataGridViewCell,
_ptCurrentCell
.Y) || !ColumnEditable(
_ptCurrentCell
.X))
2714
DataGridViewCellCancelEventArgs dgvcce = new(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
2723
if (
_ptCurrentCell
.X > -1)
2731
if (IsSharedCellReadOnly(dataGridViewCell,
_ptCurrentCell
.Y) || !ColumnEditable(
_ptCurrentCell
.X))
2753
DataGridViewCellStyle dataGridViewCellStyle = dataGridViewCell.GetInheritedStyle(inheritedCellStyle: null,
_ptCurrentCell
.Y, includeColors: true);
2798
((IDataGridViewEditingControl)EditingControl).EditingControlRowIndex =
_ptCurrentCell
.Y;
2818
if (_toolTipControl.Activated && _ptToolTipCell ==
_ptCurrentCell
)
2835
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3165
if (
_ptCurrentCell
.X != -1)
3167
Debug.Assert(
_ptCurrentCell
.Y != -1);
3169
int oldCurrentCellX =
_ptCurrentCell
.X;
3227
_ptCurrentCell
.X,
3228
_ptCurrentCell
.Y,
3253
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3257
else if (
_ptCurrentCell
.X == -1 && Focused)
3327
int oldCurrentCellX =
_ptCurrentCell
.X;
3332
if (currentCellDirty ||
_ptCurrentCell
.Y == -1 ||
_ptCurrentCell
.X == -1)
3360
if (
_ptCurrentCell
.Y > -1)
3362
InvalidateRowPrivate(
_ptCurrentCell
.Y);
3366
DataGridViewCellStyle dataGridViewCellStyle = dataGridViewCell.GetInheritedStyle(inheritedCellStyle: null,
_ptCurrentCell
.Y, includeColors: true);
3383
if (discardNewRow &&
_ptCurrentCell
.Y == NewRowIndex - 1)
3391
if (!IsCurrentRowDirty &&
_ptCurrentCell
.Y == NewRowIndex - 1 && _dataGridViewState1[State1_NewRowCreatedByEditing])
3431
if (
_ptCurrentCell
.X > -1)
3479
if ((DataConnection.CurrencyManager?.Count ?? 0) <=
_ptCurrentCell
.Y)
3548
if (
_ptCurrentCell
.X != -1 && SelectionMode == DataGridViewSelectionMode.FullRowSelect)
3550
InvalidateCellPrivate(
_ptCurrentCell
.X, -1);
3886
Debug.Assert(
_ptCurrentCell
.X > -1);
3889
if (
_ptCurrentCell
.X == -1)
3894
OnCellLeave(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3899
if (
_ptCurrentCell
.X == -1)
3904
OnRowLeave(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3915
if (
_ptCurrentCell
.X > -1 &&
_ptCurrentCell
.Y > -1)
3917
InvalidateCellPrivate(columnIndex:
_ptCurrentCell
.X, rowIndex:
_ptCurrentCell
.Y);
3925
if (
_ptCurrentCell
.X == -1)
3930
if (OnCellValidating(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y, context))
3934
if (
_ptCurrentCell
.X == -1)
3941
_ptCurrentCell
.X,
3942
_ptCurrentCell
.Y,
3949
if (
_ptCurrentCell
.X == -1)
3954
OnCellEnter(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3957
if (
_ptCurrentCell
.X == -1)
3964
_ptCurrentCell
.X,
3965
_ptCurrentCell
.Y,
3975
if (
_ptCurrentCell
.X == -1)
3980
OnCellValidated(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
3985
if (
_ptCurrentCell
.X == -1 || !IsCurrentCellInEditMode)
4001
Debug.Assert(
_ptCurrentCell
.X > -1);
4002
if (
_ptCurrentCell
.X == -1)
4007
if (OnCellValidating(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y, context))
4009
if (
_ptCurrentCell
.X == -1)
4016
_ptCurrentCell
.X,
4017
_ptCurrentCell
.Y,
4041
if (
_ptCurrentCell
.X == -1)
4048
_ptCurrentCell
.X,
4049
_ptCurrentCell
.Y,
4083
if (
_ptCurrentCell
.X == -1)
4088
OnCellValidated(ref dataGridViewCurrentCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
4148
Debug.Assert(
_ptCurrentCell
.X > -1);
4149
if (
_ptCurrentCell
.X == -1)
4154
int columnIndex =
_ptCurrentCell
.X;
4155
int rowIndex =
_ptCurrentCell
.Y;
4199
fireRowLeave:
_ptCurrentCell
.Y != rowIndex,
4200
fireRowEnter:
_ptCurrentCell
.Y != rowIndex,
4209
if (
_ptCurrentCell
.Y != rowIndex &&
_ptCurrentCell
.Y != -1)
4212
int columnIndexTmp =
_ptCurrentCell
.X;
4213
int rowIndexTmp =
_ptCurrentCell
.Y;
4264
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
4284
if (forCurrentCellChange &&
_ptCurrentCell
.X == -1 && lastVisibleRowIndex != -1)
5632
Debug.Assert(
_ptCurrentCell
.Y == NewRowIndex);
5905
Debug.Assert(
_ptCurrentCell
.X != -1);
6118
Debug.Assert(
_ptCurrentCell
.X != -1);
6128
Debug.Assert(
_ptCurrentCell
.X != -1);
6338
if (
_ptCurrentCell
.X == -1)
6346
int curRowIndex =
_ptCurrentCell
.Y;
6347
int curColIndex =
_ptCurrentCell
.X;
6391
if (curRowIndex !=
_ptCurrentCell
.Y || curColIndex !=
_ptCurrentCell
.X)
6415
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
6442
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
9102
|| (
_ptCurrentCell
.Y != -1 && (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Frozen) == 0))
9154
if (((_ptAnchorCell.X != -1 && !Columns[_ptAnchorCell.X].Frozen) || (
_ptCurrentCell
.X != -1 && !Columns[
_ptCurrentCell
.X].Frozen))
10085
_uneditedFormattedValue = dataGridViewCell.GetFormattedValue(
_ptCurrentCell
.Y, ref dataGridViewCellStyle, DataGridViewDataErrorContexts.Formatting);
10095
Debug.Assert(
_ptCurrentCell
.X == dataGridViewCell.ColumnIndex);
10096
dataGridViewCell = Rows[
_ptCurrentCell
.Y].Cells[
_ptCurrentCell
.X]; // un-share the edited cell
10106
_ptCurrentCell
.X,
10107
_ptCurrentCell
.Y,
10136
object? initialFormattedValue = dataGridViewCell.GetFormattedValue(
_ptCurrentCell
.Y, ref dataGridViewCellStyle, DataGridViewDataErrorContexts.Formatting);
10141
dataGridViewCell.InitializeEditingControl(
_ptCurrentCell
.Y, initialFormattedValue, dataGridViewCellStyle);
10148
_ptCurrentCell
.X,
10149
_ptCurrentCell
.Y,
10524
&&
_ptCurrentCell
.X != -1)
12463
if (
_ptCurrentCell
.X == -1)
12480
if (
_ptCurrentCell
.X >= 0 && (
_ptCurrentCell
.X != hti._col ||
_ptCurrentCell
.Y != hti._row))
12482
Point ptOriginalCurrentCell =
_ptCurrentCell
;
12485
forCurrentCellChange:
_ptCurrentCell
.X != hti._col ||
_ptCurrentCell
.Y != hti._row,
12486
forCurrentRowChange:
_ptCurrentCell
.Y != hti._row))
12492
if (
_ptCurrentCell
!= ptOriginalCurrentCell)
12505
if (
_ptCurrentCell
.X == -1 && dataGridViewLastVisibleColumn is not null)
12521
if (
_ptCurrentCell
.X == -1 && lastVisibleRowIndex != -1)
12567
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
12568
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
12757
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
12758
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
12963
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
12964
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
13173
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
13174
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
13175
if ((hti._col !=
_ptCurrentCell
.X || hti._row !=
_ptCurrentCell
.Y)
13198
if (hti._col !=
_ptCurrentCell
.X || hti._row !=
_ptCurrentCell
.Y)
13232
&&
_ptCurrentCell
.X == dataGridViewCell.ColumnIndex
13233
&&
_ptCurrentCell
.Y == dataGridViewCell.RowIndex
13240
&& ColumnEditable(
_ptCurrentCell
.X)
14108
if (rowIndex > -1 && hti._col !=
_ptCurrentCell
.X)
14111
int oldCurrentCellX =
_ptCurrentCell
.X;
14112
int oldCurrentCellY =
_ptCurrentCell
.Y;
14118
fireRowLeave: rowIndex !=
_ptCurrentCell
.Y,
14119
fireRowEnter: rowIndex !=
_ptCurrentCell
.Y,
14250
if (hti._col !=
_ptCurrentCell
.X)
14272
else if (
_ptCurrentCell
.X != -1)
14276
_ptCurrentCell
.X,
14277
_ptCurrentCell
.Y,
14537
if (
_ptCurrentCell
.X != -1 && hti._col !=
_ptCurrentCell
.X && !CommitEditForOperation(hti._col,
_ptCurrentCell
.Y, true))
14619
if (
_ptCurrentCell
.X != -1 && hti._col !=
_ptCurrentCell
.X)
14621
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(hti._col))
14628
_ptCurrentCell
.Y,
14847
&& dataGridViewColumn.Index ==
_ptCurrentCell
.X
14853
&& ColumnEditable(
_ptCurrentCell
.X)
14854
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.ReadOnly) == 0
14930
PositionEditingControl(
_ptCurrentCell
.X != e.Column.Index, true, false);
14958
|| (columnIndex ==
_ptCurrentCell
.X && rowIndex ==
_ptCurrentCell
.Y))))
14989
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
14992
if (IsCurrentCellDirty && NewRowIndex ==
_ptCurrentCell
.Y)
15132
else if (dataGridViewColumn.Visible &&
_ptCurrentCell
.X == dataGridViewColumn.Index)
15153
if (
_ptCurrentCell
.X == dataGridViewColumn.Index
15193
if (elementState == DataGridViewElementStates.Visible &&
_ptCurrentCell
.Y == rowIndex)
15201
Debug.Assert(DataConnection.CurrencyManager.Position ==
_ptCurrentCell
.Y);
15215
if (
_ptCurrentCell
.Y == rowIndex
15253
if (
_ptCurrentCell
.X == dataGridViewCell.ColumnIndex
15254
&&
_ptCurrentCell
.Y == dataGridViewCell.RowIndex
15370
if (Focused && EditMode == DataGridViewEditMode.EditOnEnter &&
_ptCurrentCell
.X > -1 && !IsCurrentCellInEditMode)
15423
if (
_ptCurrentCell
.X > -1)
15431
_ptCurrentCell
.X,
15432
_ptCurrentCell
.Y,
15435
if (
_ptCurrentCell
.X == -1)
15440
OnCellEnter(ref dataGridViewCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
15445
InvalidateCellPrivate(
_ptCurrentCell
.X, -1);
15454
if (
_ptCurrentCell
.X > -1 && !IsCurrentCellInEditMode)
15460
if (
_ptCurrentCell
.X > -1 && CurrentCellInternal.EditType is null && !_dataGridViewOper[OperationInMouseDown])
15465
InvalidateCellPrivate(columnIndex:
_ptCurrentCell
.X, rowIndex:
_ptCurrentCell
.Y);
15474
InvalidateCellPrivate(columnIndex:
_ptCurrentCell
.X, rowIndex:
_ptCurrentCell
.Y);
15597
if (
_ptCurrentCell
.X != -1)
15599
InvalidateCell(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
15606
&&
_ptCurrentCell
.X > -1)
15611
AccessibilityNotifyCurrentCellChanged(
_ptCurrentCell
);
15639
if (
_ptCurrentCell
.X == -1)
15645
ScrollIntoView(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, forCurrentCellChange: false);
15681
Debug.Assert(
_ptCurrentCell
.X == -1);
15719
Debug.Assert(
_ptCurrentCell
.X == -1);
15759
Debug.Assert(
_ptCurrentCell
.X == -1);
15818
if (
_ptCurrentCell
.X != -1)
15820
newCurrentCell = new Point(columnIndexInserted <=
_ptCurrentCell
.X ?
_ptCurrentCell
.X + 1 :
_ptCurrentCell
.X,
15821
_ptCurrentCell
.Y);
15937
if (
_ptCurrentCell
.Y != -1 && rowIndexInserted <=
_ptCurrentCell
.Y)
15939
newCurrentCell = new Point(
_ptCurrentCell
.X,
_ptCurrentCell
.Y + insertionCount);
16020
if (
_ptCurrentCell
.Y != -1 && rowIndexInserted <=
_ptCurrentCell
.Y)
16022
newCurrentCell = new Point(
_ptCurrentCell
.X,
_ptCurrentCell
.Y + dataGridViewRows.Length);
16085
if (
_ptCurrentCell
.X != -1)
16089
if (dataGridViewCell.KeyDownUnsharesRowInternal(e,
_ptCurrentCell
.Y))
16091
DataGridViewRow dataGridViewRow = Rows[
_ptCurrentCell
.Y];
16092
CurrentCellInternal.OnKeyDownInternal(e,
_ptCurrentCell
.Y);
16096
dataGridViewCell.OnKeyDownInternal(e,
_ptCurrentCell
.Y);
16143
if (
_ptCurrentCell
.X != -1)
16147
if (dataGridViewCell.KeyPressUnsharesRowInternal(e,
_ptCurrentCell
.Y))
16149
DataGridViewRow dataGridViewRow = Rows[
_ptCurrentCell
.Y];
16150
CurrentCellInternal.OnKeyPressInternal(e,
_ptCurrentCell
.Y);
16154
dataGridViewCell.OnKeyPressInternal(e,
_ptCurrentCell
.Y);
16176
if (
_ptCurrentCell
.X != -1)
16180
if (dataGridViewCell.KeyUpUnsharesRowInternal(e,
_ptCurrentCell
.Y))
16182
DataGridViewRow dataGridViewRow = Rows[
_ptCurrentCell
.Y];
16183
CurrentCellInternal.OnKeyUpInternal(e,
_ptCurrentCell
.Y);
16187
dataGridViewCell.OnKeyUpInternal(e,
_ptCurrentCell
.Y);
16218
if (
_ptCurrentCell
.X > -1 && !_dataGridViewState1[State1_LeavingWithTabKey])
16221
OnCellLeave(ref dataGridViewCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
16222
if (
_ptCurrentCell
.X == -1)
16227
OnRowLeave(ref dataGridViewCell,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
16235
if (
_ptCurrentCell
.X > -1 &&
_ptCurrentCell
.Y > -1)
16237
InvalidateCellPrivate(columnIndex:
_ptCurrentCell
.X, rowIndex:
_ptCurrentCell
.Y);
16251
if (
_ptCurrentCell
.X != -1)
16253
InvalidateCell(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
16281
|| (_ptMouseDownCell.X ==
_ptCurrentCell
.X && _ptMouseDownCell.Y ==
_ptCurrentCell
.Y)))
16913
if (
_ptCurrentCell
.X >= 0 && !CommitEdit(
16956
if (
_ptCurrentCell
.X >= 0 && !CommitEdit(
17265
&&
_ptCurrentCell
.X != -1
17266
&& ColumnEditable(
_ptCurrentCell
.X)
17270
&& !Rows[
_ptCurrentCell
.Y].Cells[
_ptCurrentCell
.X].ReadOnly) // Un-shares the row
17305
Debug.Assert(
_ptCurrentCell
.X == -1);
17356
Debug.Assert(
_ptCurrentCell
.X == -1);
17438
if (
_ptCurrentCell
.X != -1)
17440
int newX =
_ptCurrentCell
.X;
17441
if (columnIndex ==
_ptCurrentCell
.X)
17481
else if (columnIndex <
_ptCurrentCell
.X)
17483
newX =
_ptCurrentCell
.X - 1;
17486
newCurrentCell = new Point(newX, (newX == -1) ? -1 :
_ptCurrentCell
.Y);
17487
if (columnIndex ==
_ptCurrentCell
.X)
17673
if (
_ptCurrentCell
.Y != -1 && rowIndexDeleted <=
_ptCurrentCell
.Y)
17676
if (rowIndexDeleted ==
_ptCurrentCell
.Y)
17711
Debug.Assert(rowIndexDeleted <
_ptCurrentCell
.Y);
17712
newY =
_ptCurrentCell
.Y - 1;
17715
newCurrentCell = new Point(
_ptCurrentCell
.X, newY);
17716
if (rowIndexDeleted ==
_ptCurrentCell
.Y)
17838
if (
_ptCurrentCell
.X == dataGridViewRow.Index &&
_ptCurrentCell
.Y == columnIndex)
17842
_ptCurrentCellCache.X =
_ptCurrentCell
.X;
17843
_ptCurrentCellCache.Y =
_ptCurrentCell
.Y;
17983
&&
_ptCurrentCell
.X == -1
18384
if (dataGridViewColumn is not null && hti._row !=
_ptCurrentCell
.Y)
18386
int oldCurrentCellX =
_ptCurrentCell
.X;
18387
int oldCurrentCellY =
_ptCurrentCell
.Y;
18394
fireRowLeave: hti._row !=
_ptCurrentCell
.Y,
18395
fireRowEnter: hti._row !=
_ptCurrentCell
.Y,
18447
if (
_ptCurrentCell
.X == -1 && lastVisibleRowIndex != -1)
18558
if (hti._row !=
_ptCurrentCell
.Y)
18576
else if (
_ptCurrentCell
.Y != -1)
18580
_ptCurrentCell
.X,
18581
_ptCurrentCell
.Y,
18838
if (
_ptCurrentCell
.Y != -1
18839
&& hti._row !=
_ptCurrentCell
.Y
18840
&& !CommitEditForOperation(
_ptCurrentCell
.X, hti._row, forCurrentCellChange: true))
18917
if (
_ptCurrentCell
.Y != -1 && hti._row !=
_ptCurrentCell
.Y)
18924
bool success = SetCurrentCellAddressCore(
_ptCurrentCell
.X,
19114
if (e.StateChanged == DataGridViewElementStates.ReadOnly && rowIndex ==
_ptCurrentCell
.Y && !_dataGridViewOper[OperationInReadOnlyChange])
19120
&& !Columns[
_ptCurrentCell
.X].ReadOnly
19121
&& ColumnEditable(
_ptCurrentCell
.X)
19134
if (
_ptCurrentCell
.X != -1 && dataGridViewRow.Index ==
_ptCurrentCell
.Y && EditingControl is not null)
19415
if (
_ptCurrentCell
.X != -1)
19419
_ptCurrentCell
.X,
19420
_ptCurrentCell
.Y,
19498
if (
_ptCurrentCell
.X >= 0)
19501
if (OnRowValidating(ref dataGridViewCellTmp,
_ptCurrentCell
.X,
_ptCurrentCell
.Y))
19508
if (
_ptCurrentCell
.X == -1)
19513
OnRowValidated(ref dataGridViewCellTmp,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
19516
if (DataSource is not null &&
_ptCurrentCell
.X >= 0 && AllowUserToAddRowsInternal && NewRowIndex ==
_ptCurrentCell
.Y)
19519
int rowIndex = Rows.GetPreviousRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
19523
_ptCurrentCell
.X,
20250
Debug.Assert(dataGridViewCell.ColumnIndex ==
_ptCurrentCell
.X);
20251
Debug.Assert(dataGridViewCell.RowIndex ==
_ptCurrentCell
.Y || dataGridViewCell.RowIndex == -1);
20264
int leftEdge = GetColumnXFromIndex(
_ptCurrentCell
.X);
20267
leftEdge -= Columns[
_ptCurrentCell
.X].Width - 1;
20270
Rectangle cellBounds = new(leftEdge, GetRowYFromIndex(
_ptCurrentCell
.Y),
20271
Columns[
_ptCurrentCell
.X].Width, Rows.SharedRow(
_ptCurrentCell
.Y).GetHeight(
_ptCurrentCell
.Y));
20274
if (!Columns[
_ptCurrentCell
.X].Frozen)
20285
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Frozen) == 0)
20310
bool isFirstDisplayedColumn = FirstDisplayedColumnIndex ==
_ptCurrentCell
.X;
20311
bool isFirstDisplayedRow = FirstDisplayedRowIndex ==
_ptCurrentCell
.Y;
20522
if (
_ptCurrentCell
.X > -1
20612
if (
_ptCurrentCell
.Y != -1)
20614
nextVisibleRowIndex = Rows.GetNextRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
20630
if (
_ptCurrentCell
.X == -1)
20656
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20662
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
20663
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
20664
if (
_ptCurrentCell
.X == -1 || _ptAnchorCell.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20677
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, false, false, false);
20685
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20690
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20697
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
20698
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20708
if (
_ptCurrentCell
.X == -1)
20728
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20733
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20740
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
20741
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20753
if (
_ptCurrentCell
.X == -1)
20779
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
20784
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20792
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
20793
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
20811
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
20814
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, !MultiSelect, false, false);
20823
if (
_ptCurrentCell
.X == -1)
20849
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, forCurrentCellChange: true))
20854
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
20861
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
20863
_ptCurrentCell
.X,
20883
if (
_ptCurrentCell
.X == -1)
20905
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20910
if (_ptAnchorCell.Y == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20919
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, false, false, false);
20927
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20932
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20938
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
20940
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20950
if (
_ptCurrentCell
.X == -1)
20970
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
20975
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
20983
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
20995
if (
_ptCurrentCell
.X == -1)
21021
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
21026
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
21055
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, !MultiSelect, false, false);
21064
if (
_ptCurrentCell
.X == -1)
21090
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
21095
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
21103
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true, false, false);
21119
if (
_ptCurrentCell
.X == -1)
21141
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
21147
if (_ptAnchorCell.Y == -1 ||
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
21153
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21160
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21161
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21171
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, false, false, false);
21179
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
21184
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
21190
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21192
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
21197
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
21198
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
21201
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
21211
if (
_ptCurrentCell
.X == -1)
21231
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
21236
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
21242
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21250
SetSelectedCellCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true);
21253
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
21265
if (
_ptCurrentCell
.X == -1)
21291
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
21296
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
21302
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21331
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21332
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21350
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
21354
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, !MultiSelect, false, false);
21363
if (
_ptCurrentCell
.X == -1)
21389
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
21394
if (
_ptCurrentCell
.Y == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
21400
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21408
SetSelectedCellCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true);
21411
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true, false, false);
21425
if (
_ptCurrentCell
.X == -1)
21445
if (!ScrollIntoView(
_ptCurrentCell
.X, lastVisibleRowIndex, true))
21450
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(lastVisibleRowIndex))
21456
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, lastVisibleRowIndex, true, false, false);
21465
if (
_ptCurrentCell
.X == -1)
21491
if (!ScrollIntoView(
_ptCurrentCell
.X, nextVisibleRowIndex, true))
21496
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextVisibleRowIndex))
21502
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextVisibleRowIndex, true, false, false);
21560
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21561
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21609
if (
_ptCurrentCell
.Y > -1
21610
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21613
SelectRowRange(
_ptCurrentCell
.Y, lastVisibleRowIndex, select: true);
21617
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21618
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21630
if (
_ptCurrentCell
.Y > -1
21631
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21647
if (
_ptCurrentCell
.Y > -1
21648
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
21685
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
21724
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
21741
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
21743
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
21744
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
21779
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
21816
if (MultiSelect &&
_ptCurrentCell
.Y >= 0)
21871
if (
_ptCurrentCell
.X != -1)
21910
int columnIndex =
_ptCurrentCell
.X;
21911
int rowIndex =
_ptCurrentCell
.Y;
21953
if (
_ptCurrentCell
.X != -1 && !IsCurrentCellInEditMode && ModifierKeys == 0)
21955
Debug.Assert(
_ptCurrentCell
.Y != -1);
21958
|| IsSharedCellReadOnly(CurrentCellInternal,
_ptCurrentCell
.Y)
21959
|| !ColumnEditable(
_ptCurrentCell
.X));
21961
if (ColumnEditable(
_ptCurrentCell
.X)
21962
&& !IsSharedCellReadOnly(CurrentCellInternal,
_ptCurrentCell
.Y)
21965
bool success = ScrollIntoView(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, forCurrentCellChange: false);
21982
if (
_ptCurrentCell
.X != -1)
21984
DataGridViewColumn dataGridViewColumn = Columns[
_ptCurrentCell
.X];
22034
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22035
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22083
if (
_ptCurrentCell
.Y > -1
22084
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
22091
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22092
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22104
if (
_ptCurrentCell
.Y > -1
22105
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
22121
if (
_ptCurrentCell
.Y > -1
22122
&& (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
22159
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
22203
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
22220
if (MultiSelect &&
_ptCurrentCell
.X >= 0)
22222
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22223
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22258
if (
_ptCurrentCell
.X >= 0 && Columns[
_ptCurrentCell
.X].Selected)
22330
if (
_ptCurrentCell
.X != -1)
22336
&& ColumnEditable(
_ptCurrentCell
.X)
22337
&& !IsSharedCellReadOnly(dataGridViewCell,
_ptCurrentCell
.Y)
22354
bool success = ScrollIntoView(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
22462
if ((keyData & Keys.Alt) == Keys.Alt && AllowUserToResizeColumns &&
_ptCurrentCell
.X != -1)
22466
DataGridViewColumn dataGridViewColumn = Columns[
_ptCurrentCell
.X];
22471
BeginKeyboardColumnResize(
_ptCurrentCell
.X);
22498
if (CurrentCell is null ||
_ptCurrentCell
.X == -1 ||
_ptCurrentCell
.Y == -1)
22548
if (
_ptCurrentCell
.X != -1)
22550
dataGridViewColumn = Columns.GetPreviousColumn(Columns[
_ptCurrentCell
.X],
22574
if (
_ptCurrentCell
.X == -1)
22595
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22600
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22608
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22609
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22626
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22629
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
22635
if (
_ptCurrentCell
.X == -1)
22656
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22661
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22667
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22668
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22685
if (
_ptCurrentCell
.X == -1)
22706
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22711
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22738
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
22744
if (
_ptCurrentCell
.X == -1)
22765
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22770
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22777
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22794
if (
_ptCurrentCell
.X == -1)
22815
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22820
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22825
if (Columns[
_ptCurrentCell
.X].Selected)
22851
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
22852
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
22869
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22873
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
22879
if (
_ptCurrentCell
.X == -1)
22900
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22905
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22910
if (Columns[
_ptCurrentCell
.X].Selected)
22918
SetSelectedCellCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true);
22921
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22936
if (
_ptCurrentCell
.X == -1)
22957
if (!ScrollIntoView(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true))
22962
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(previousVisibleColumnIndex))
22967
success = SetCurrentCellAddressCore(previousVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
22998
if (
_ptCurrentCell
.X == -1)
23016
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23022
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23023
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23024
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
23038
_ptCurrentCell
.Y,
23046
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23051
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
23057
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23060
_ptCurrentCell
.Y,
23070
if (
_ptCurrentCell
.X == -1)
23091
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, forCurrentCellChange: true))
23096
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
23102
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, selected: true);
23105
_ptCurrentCell
.Y,
23118
if (
_ptCurrentCell
.X == -1)
23141
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23146
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
23154
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
23159
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23164
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
23169
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
23171
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23178
if (
_ptCurrentCell
.X == -1)
23194
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23199
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
23206
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23216
if (
_ptCurrentCell
.X == -1)
23234
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23239
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
23245
if (Columns[
_ptCurrentCell
.X].Selected)
23252
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23253
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23263
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
23268
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23273
if (
_ptCurrentCell
.X == -1 || IsInnerCellOutOfBounds(firstVisibleColumnIndex, firstVisibleRowIndex))
23278
if (Columns[
_ptCurrentCell
.X].Selected)
23280
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
23285
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
23286
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23289
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23296
if (
_ptCurrentCell
.X == -1)
23312
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23317
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
23322
if (Columns[
_ptCurrentCell
.X].Selected)
23330
SetSelectedCellCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true);
23333
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23341
if (
_ptCurrentCell
.X == -1)
23357
if (!ScrollIntoView(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23362
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(firstVisibleColumnIndex))
23367
success = SetCurrentCellAddressCore(firstVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
23393
if (
_ptCurrentCell
.Y == -1)
23403
nextScreenVisibleRowIndex =
_ptCurrentCell
.Y;
23412
if (!ScrollIntoView(
_ptCurrentCell
.X == -1 ? firstVisibleColumnIndex :
_ptCurrentCell
.X,
23419
_ptCurrentCell
.Y,
23450
if (
_ptCurrentCell
.X == -1)
23483
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23488
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23496
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23497
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23514
SetSelectedCellCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true);
23517
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, false, false, false);
23522
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23527
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23555
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, false, false, false);
23559
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23564
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23577
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23591
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23592
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23604
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23612
SetSelectedCellCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true);
23616
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, !MultiSelect, false, false);
23620
if (!ScrollIntoView(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true))
23625
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(nextScreenVisibleRowIndex))
23630
success = SetCurrentCellAddressCore(
_ptCurrentCell
.X, nextScreenVisibleRowIndex, true, false, false);
23652
if (
_ptCurrentCell
.Y == -1)
23662
previousScreenVisibleRowIndex =
_ptCurrentCell
.Y;
23698
_ptCurrentCell
.X == -1 ? firstVisibleColumnIndex :
_ptCurrentCell
.X,
23714
if (
_ptCurrentCell
.X == -1)
23746
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23751
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23759
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23760
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23777
SetSelectedCellCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true);
23780
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, false, false, false);
23784
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23789
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23817
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, false, false, false);
23821
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23826
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23839
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23853
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23854
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
23866
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
23874
SetSelectedCellCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true);
23878
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, !MultiSelect, false, false);
23882
if (!ScrollIntoView(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true))
23887
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousScreenVisibleRowIndex))
23892
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousScreenVisibleRowIndex, true, false, false);
23936
if (
_ptCurrentCell
.X != -1)
23938
dataGridViewColumn = Columns.GetNextColumn(Columns[
_ptCurrentCell
.X],
23962
if (
_ptCurrentCell
.X == -1)
23983
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
23988
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
23995
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
23996
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24013
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
24016
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
24022
if (
_ptCurrentCell
.X == -1)
24043
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24048
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
24054
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
24055
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24072
if (
_ptCurrentCell
.X == -1)
24093
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24098
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
24125
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
24131
if (
_ptCurrentCell
.X == -1)
24152
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24157
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
24164
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24181
if (
_ptCurrentCell
.X == -1)
24202
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24207
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
24212
if (Columns[
_ptCurrentCell
.X].Selected)
24245
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
24246
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24258
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
24262
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, !MultiSelect, false, false);
24268
if (
_ptCurrentCell
.X == -1)
24289
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24294
if (
_ptCurrentCell
.X == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
24299
if (Columns[
_ptCurrentCell
.X].Selected)
24307
SetSelectedCellCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true);
24310
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24325
if (
_ptCurrentCell
.X == -1)
24346
if (!ScrollIntoView(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24351
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(nextVisibleColumnIndex))
24356
success = SetCurrentCellAddressCore(nextVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24387
if (
_ptCurrentCell
.X == -1)
24403
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24408
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24421
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
24422
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24430
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
24436
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
24437
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24444
if (
_ptCurrentCell
.X == -1)
24460
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24465
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24471
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
24472
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24482
if (
_ptCurrentCell
.X == -1)
24498
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24503
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24518
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
24523
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
24525
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24532
if (
_ptCurrentCell
.X == -1)
24548
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24553
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24560
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24570
if (
_ptCurrentCell
.X == -1)
24586
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24591
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24604
if (Columns[
_ptCurrentCell
.X].Selected)
24611
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
24612
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
24622
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, false, false, false);
24627
if (Columns[
_ptCurrentCell
.X].Selected)
24629
SetSelectedColumnCore(
_ptCurrentCell
.X, false);
24634
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
24635
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
24638
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24645
if (
_ptCurrentCell
.X == -1)
24661
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24666
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24671
if (Columns[
_ptCurrentCell
.X].Selected)
24679
SetSelectedCellCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true);
24682
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24690
if (
_ptCurrentCell
.X == -1)
24706
if (!ScrollIntoView(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true))
24711
if (
_ptCurrentCell
.Y == -1 || IsColumnOutOfBounds(lastVisibleColumnIndex))
24716
success = SetCurrentCellAddressCore(lastVisibleColumnIndex,
_ptCurrentCell
.Y, true, false, false);
24733
if ((keyData & (Keys.Control | Keys.Shift | Keys.Alt)) == Keys.Shift &&
_ptCurrentCell
.X != -1)
24752
if (_selectedBandIndexes[bandIndex] !=
_ptCurrentCell
.X)
24764
if (!Columns[
_ptCurrentCell
.X].Selected)
24766
Debug.Assert(!_selectedBandIndexes.Contains(
_ptCurrentCell
.X));
24767
SetSelectedColumnCore(
_ptCurrentCell
.X, true);
24779
if (_selectedBandIndexes[bandIndex] !=
_ptCurrentCell
.Y)
24791
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) == 0)
24793
Debug.Assert(!_selectedBandIndexes.Contains(
_ptCurrentCell
.Y));
24794
SetSelectedRowCore(
_ptCurrentCell
.Y, true);
25016
if (
_ptCurrentCell
.Y != -1)
25018
previousVisibleRowIndex = Rows.GetPreviousRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
25032
if (
_ptCurrentCell
.X == -1)
25048
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
25053
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25059
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
25060
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
25068
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, false, false, false);
25072
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
25077
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25083
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
25084
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25090
if (
_ptCurrentCell
.X == -1)
25104
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
25109
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25115
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
25116
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25124
if (
_ptCurrentCell
.X == -1)
25143
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25148
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25161
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
25162
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
25174
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true);
25177
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, !MultiSelect, false, false);
25182
if (
_ptCurrentCell
.X == -1)
25201
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25206
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25212
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, selected: true);
25214
_ptCurrentCell
.X,
25230
if (
_ptCurrentCell
.X == -1)
25246
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
25251
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25259
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, false, false, false);
25263
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
25268
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25273
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
25275
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25281
if (
_ptCurrentCell
.X == -1)
25295
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
25300
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25307
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25315
if (
_ptCurrentCell
.X == -1)
25334
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25339
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25366
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, !MultiSelect, false, false);
25371
if (
_ptCurrentCell
.X == -1)
25390
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25395
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25402
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true, false, false);
25414
if (
_ptCurrentCell
.X == -1)
25430
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
25435
if (_ptAnchorCell.X == -1 ||
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25441
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25448
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
25449
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
25459
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, false, false, false);
25463
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
25468
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25473
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25475
SetSelectedRowCore(
_ptCurrentCell
.Y, false);
25480
SetSelectedCellCore(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
25481
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
25484
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25490
if (
_ptCurrentCell
.X == -1)
25504
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, true))
25509
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25514
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25522
SetSelectedCellCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true);
25525
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25533
if (
_ptCurrentCell
.X == -1)
25552
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25557
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25562
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25588
int oldEdgeColumnIndex =
_ptCurrentCell
.X;
25589
int oldEdgeRowIndex =
_ptCurrentCell
.Y;
25606
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true);
25610
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, !MultiSelect, false, false);
25615
if (
_ptCurrentCell
.X == -1)
25634
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25639
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25644
if ((Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Selected) != 0)
25652
SetSelectedCellCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true);
25655
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true, false, false);
25665
if (
_ptCurrentCell
.X == -1)
25684
if (!ScrollIntoView(
_ptCurrentCell
.X, firstVisibleRowIndex, forCurrentCellChange: true))
25689
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(firstVisibleRowIndex))
25694
SetCurrentCellAddressCore(
_ptCurrentCell
.X, firstVisibleRowIndex, true, false, false);
25699
if (
_ptCurrentCell
.X == -1)
25718
if (!ScrollIntoView(
_ptCurrentCell
.X, previousVisibleRowIndex, true))
25723
if (
_ptCurrentCell
.X == -1 || IsRowOutOfBounds(previousVisibleRowIndex))
25728
SetCurrentCellAddressCore(
_ptCurrentCell
.X, previousVisibleRowIndex, true, false, false);
25745
if (
_ptCurrentCell
.X != -1 && !IsCurrentCellInEditMode && ColumnEditable(
_ptCurrentCell
.X))
25750
if (!IsSharedCellReadOnly(dataGridViewCell,
_ptCurrentCell
.Y)
25754
bool success = ScrollIntoView(
_ptCurrentCell
.X,
_ptCurrentCell
.Y, false);
25767
object? nullValue = dataGridViewCurrentCell.GetInheritedStyle(inheritedCellStyle: null,
_ptCurrentCell
.Y, includeColors: false).NullValue;
25785
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
25826
_ptCurrentCell
.Y,
25827
_ptCurrentCell
.X,
25840
dataGridViewCurrentCell = Rows[
_ptCurrentCell
.Y].Cells[
_ptCurrentCell
.X];
25843
return dataGridViewCurrentCell.SetValueInternal(
_ptCurrentCell
.Y, dgvcpe.Value);
25865
dataGridViewCurrentCell = Rows[
_ptCurrentCell
.Y].Cells[
_ptCurrentCell
.X];
25868
return dataGridViewCurrentCell.SetValueInternal(
_ptCurrentCell
.Y, val);
25947
if (
_ptCurrentCell
.X != -1 && IsCurrentCellInEditMode)
25949
Debug.Assert(
_ptCurrentCell
.Y != -1);
25951
DataGridViewCellStyle dataGridViewCellStyle = dataGridViewCurrentCell.GetInheritedStyle(inheritedCellStyle: null,
_ptCurrentCell
.Y, includeColors: true);
26491
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26493
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26494
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26509
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26511
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26512
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26523
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26525
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26526
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26690
if (
_ptCurrentCell
.X >= 0 && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex))
26751
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26753
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26754
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26780
if (!committed &&
_ptCurrentCell
.X >= 0 && !CommitEdit(
26782
forCurrentCellChange: forCurrentCellChange && (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex),
26783
forCurrentRowChange:
_ptCurrentCell
.Y != rowIndex))
26832
if (EditingControl is not null && (Rows.GetRowState(
_ptCurrentCell
.Y) & DataGridViewElementStates.Frozen) == 0)
27266
if (
_ptCurrentCell
.X != columnIndex ||
_ptCurrentCell
.Y != rowIndex)
27271
_ptCurrentCell
.X = columnIndex;
27272
_ptCurrentCell
.Y = rowIndex;
27286
int oldCurrentCellX =
_ptCurrentCell
.X;
27287
int oldCurrentCellY =
_ptCurrentCell
.Y;
27332
Debug.Assert(oldCurrentCellX ==
_ptCurrentCell
.X);
27333
Debug.Assert(oldCurrentCellY ==
_ptCurrentCell
.Y);
27405
_ptCurrentCell
.X = columnIndex;
27406
_ptCurrentCell
.Y = rowIndex;
27427
OnCellEnter(ref dataGridViewCellTmp,
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
27436
if (oldCurrentCellY !=
_ptCurrentCell
.Y && RowHeadersVisible && oldCurrentCellY < Rows.Count)
27442
InvalidateCellPrivate(
_ptCurrentCell
.X,
_ptCurrentCell
.Y);
27443
if (RowHeadersVisible && oldCurrentCellY !=
_ptCurrentCell
.Y)
27445
InvalidateCellPrivate(-1,
_ptCurrentCell
.Y);
27449
&&
_ptCurrentCell
.X != -1
27467
if (
_ptCurrentCell
.X != -1)
27469
AccessibilityNotifyCurrentCellChanged(new Point(
_ptCurrentCell
.X,
_ptCurrentCell
.Y));
27496
int oldCurrentCellX =
_ptCurrentCell
.X;
27497
int oldCurrentCellY =
_ptCurrentCell
.Y;
27537
Debug.Assert(oldCurrentCellX ==
_ptCurrentCell
.X);
27538
Debug.Assert(oldCurrentCellY ==
_ptCurrentCell
.Y);
27562
if (
_ptCurrentCell
.X != -1)
27564
_ptCurrentCell
.X = -1;
27565
_ptCurrentCell
.Y = -1;
28702
_ptCurrentCellCache.X =
_ptCurrentCell
.X;
28703
_ptCurrentCellCache.Y =
_ptCurrentCell
.Y;
28978
if (
_ptCurrentCell
.X != -1)
28980
dataGridViewColumn = Columns.GetNextColumn(Columns[
_ptCurrentCell
.X],
28990
if (
_ptCurrentCell
.Y != -1)
28992
nextVisibleRowIndex = Rows.GetNextRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
29000
if (
_ptCurrentCell
.X == -1)
29013
targetRowIndex =
_ptCurrentCell
.Y;
29028
if (
_ptCurrentCell
.X == -1)
29051
if (
_ptCurrentCell
.X == -1)
29074
if (
_ptCurrentCell
.X == -1)
29085
if (targetRowIndex !=
_ptCurrentCell
.Y || MultiSelect)
29105
if (
_ptCurrentCell
.X == -1)
29139
if (
_ptCurrentCell
.X != -1)
29141
dataGridViewColumn = Columns.GetPreviousColumn(Columns[
_ptCurrentCell
.X],
29151
if (
_ptCurrentCell
.Y != -1)
29153
previousVisibleRowIndex = Rows.GetPreviousRow(
_ptCurrentCell
.Y, DataGridViewElementStates.Visible);
29169
if (
_ptCurrentCell
.X == -1)
29182
targetRowIndex =
_ptCurrentCell
.Y;
29197
if (
_ptCurrentCell
.X == -1)
29220
if (
_ptCurrentCell
.X == -1)
29243
if (
_ptCurrentCell
.X == -1)
29254
if (targetRowIndex !=
_ptCurrentCell
.Y || MultiSelect)
29274
if (
_ptCurrentCell
.X == -1)
29580
PositionEditingControl(rowIndex == -1 ||
_ptCurrentCell
.Y != rowIndex, true, false);