4 writes to _col
System.Windows.Forms (4)
System\Windows\Forms\Controls\DataGridView\DataGridView.HitTestInfo.cs (1)
29
_row =
_col
= -1;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (3)
9341
hti.
_col
= GetColumnIndexFromX(x, out int xColumnLeftEdge);
9481
hti.
_col
= GetColumnIndexFromX(x, out int xColumnLeftEdge);
12098
hti.
_col
= dataGridViewLastVisibleColumn.Index;
175 references to _col
System.Windows.Forms (175)
System\Windows\Forms\Controls\DataGridView\DataGridView.HitTestInfo.cs (5)
41
return
_col
;
95
value is HitTestInfo hti && _type == hti._type && _row == hti._row &&
_col
== hti.
_col
;
100
public override int GetHashCode() => HashCode.Combine(_type, _row,
_col
);
107
return $"{{ Type:{_type}, Column:{
_col
}, Row:{_row} }}";
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (170)
3649
Debug.Assert(hti.
_col
!= -1);
3653
int xColumnLeftEdge = GetColumnXFromIndex(hti.
_col
);
3654
int wColumn = Columns[hti.
_col
].Width;
3659
previousColumnIndex = hti.
_col
;
3665
Columns[hti.
_col
],
3677
? hti.
_col
3691
&& !(previousColumnIndex == -1 && hti.
_col
== _trackColumn)
3700
Debug.Assert(hti.
_col
!= -1);
3701
if (hti.
_col
!= _trackColumn)
5763
mouseX += ((hti.
_col
== -1) ? RowHeadersWidth : Columns[hti.
_col
].Thickness);
5767
hti.
_col
,
5856
hti.
_col
,
8608
if (hti.
_col
>= 0)
8610
firstColumnIndex = hti.
_col
;
8693
&& hti.
_col
>= 0
8694
&& !Columns[hti.
_col
].Frozen)
9342
if (hti.
_col
< 0)
9347
Debug.Assert(xColumnLeftEdge == GetColumnXFromIndex(hti.
_col
));
9352
int columnWidth = Columns[hti.
_col
].Thickness;
9361
DataGridViewColumn dataGridViewColumn = Columns[hti.
_col
];
9373
Columns[hti.
_col
],
9483
if (hti.
_col
< 0 || hti._row < 0)
9488
Debug.Assert(xColumnLeftEdge == GetColumnXFromIndex(hti.
_col
));
9496
int columnWidth = Columns[hti.
_col
].Thickness;
9504
DataGridViewColumn dataGridViewColumn = Columns[hti.
_col
];
9518
if (hti.
_col
!= DisplayedBandsInfo.FirstDisplayedScrollingCol || DisplayedBandsInfo.LastTotallyDisplayedScrollingCol >= 0)
9520
dataGridViewColumn = Columns.GetPreviousColumn(Columns[hti.
_col
],
9556
if (hti.
_col
== dataGridViewColumn.Index
9646
if (hti.
_col
>= 0)
9659
if (hti.
_col
>= 0 && hti._row >= 0)
9667
if (_dataGridViewOper[OperationTrackColSelect] && hti.
_col
>= 0)
9671
else if (_dataGridViewOper[OperationTrackCellSelect] && hti.
_col
>= 0 && hti._row >= 0)
11909
Debug.Assert(_ptMouseDownCell.X == hti.
_col
);
11957
int columnIndex = (hti._typeInternal == DataGridViewHitTestTypeInternal.ColumnResizeRight) ? hti.
_col
: hti._adjacentCol;
11990
BeginColumnRelocation(ptGridCoord.X, hti.
_col
);
12068
if (_ptCurrentCell.X >= 0 && (_ptCurrentCell.X != hti.
_col
|| _ptCurrentCell.Y != hti._row))
12073
forCurrentCellChange: _ptCurrentCell.X != hti.
_col
|| _ptCurrentCell.Y != hti._row,
12088
if (hti.
_col
>= Columns.Count)
12132
&& IsSharedCellSelected(Rows.SharedRow(hti._row).Cells[hti.
_col
], hti._row)
12143
RemoveIndividuallySelectedCells(hti.
_col
, hti._row);
12165
hti.
_col
,
12172
SetSelectedCellCore(hti.
_col
, hti._row, selected: true);
12177
SetSelectedCellCore(hti.
_col
, hti._row, selected: true);
12182
SetSelectedCellCore(hti.
_col
, hti._row, selected: false);
12186
hti.
_col
,
12197
if (isControlDown && Columns[hti.
_col
].Selected)
12205
_trackColumn = hti.
_col
;
12227
if (_selectedBandIndexes[bandIndex] != hti.
_col
)
12254
if (Columns.DisplayInOrder(_ptAnchorCell.X, hti.
_col
))
12256
SelectColumnRange(_ptAnchorCell.X, hti.
_col
, true);
12260
SelectColumnRange(hti.
_col
, _ptAnchorCell.X, true);
12263
else if (!_selectedBandIndexes.Contains(hti.
_col
))
12265
SetSelectedColumnCore(hti.
_col
, true);
12270
Debug.Assert(_selectedBandIndexes.Contains(hti.
_col
));
12271
SetSelectedColumnCore(hti.
_col
, false);
12275
hti.
_col
,
12287
&& (Columns[hti.
_col
].Selected || IsSharedCellSelected(Rows.SharedRow(hti._row).Cells[hti.
_col
], hti._row))
12307
SetSelectedCellCore(hti.
_col
, hti._row, true);
12327
RemoveIndividuallySelectedCells(hti.
_col
, hti._row);
12355
hti.
_col
,
12362
SetSelectedCellCore(hti.
_col
, hti._row, true);
12377
SetSelectedCellCore(hti.
_col
, hti._row, false);
12382
SetSelectedCellCore(hti.
_col
, hti._row, false);
12387
hti.
_col
,
12480
hti.
_col
,
12493
|| IsSharedCellSelected(Rows.SharedRow(hti._row).Cells[hti.
_col
], hti._row))
12513
SetSelectedCellCore(hti.
_col
, hti._row, true);
12533
RemoveIndividuallySelectedCells(hti.
_col
, hti._row);
12561
hti.
_col
,
12568
SetSelectedCellCore(hti.
_col
, hti._row, selected: true);
12583
SetSelectedCellCore(hti.
_col
, hti._row, selected: false);
12588
SetSelectedCellCore(hti.
_col
, hti._row, false);
12593
hti.
_col
,
12767
if ((hti.
_col
!= _ptCurrentCell.X || hti._row != _ptCurrentCell.Y)
12768
&& !CommitEditForOperation(hti.
_col
, hti._row, forCurrentCellChange: true))
12777
if (_ptAnchorCell.X == -1 || IsInnerCellOutOfBounds(hti.
_col
, hti._row))
12785
hti.
_col
,
12790
if (hti.
_col
!= _ptCurrentCell.X || hti._row != _ptCurrentCell.Y)
12793
hti.
_col
,
13692
if (isControlDown && Columns[hti.
_col
].Selected)
13700
if (rowIndex > -1 && hti.
_col
!= _ptCurrentCell.X)
13761
if (IsColumnOutOfBounds(hti.
_col
))
13767
_trackColumn = hti.
_col
;
13789
if (_selectedBandIndexes[bandIndex] != hti.
_col
)
13825
if (Columns.DisplayInOrder(_ptAnchorCell.X, hti.
_col
))
13827
SelectColumnRange(_ptAnchorCell.X, hti.
_col
, true);
13831
SelectColumnRange(hti.
_col
, _ptAnchorCell.X, true);
13834
else if (!_selectedBandIndexes.Contains(hti.
_col
))
13836
SetSelectedColumnCore(hti.
_col
, true);
13842
if (hti.
_col
!= _ptCurrentCell.X)
13844
if (IsInnerCellOutOfBounds(hti.
_col
, rowIndex))
13849
bool success = ScrollIntoView(hti.
_col
, rowIndex, forCurrentCellChange: false);
13851
if (IsInnerCellOutOfBounds(hti.
_col
, rowIndex))
13857
hti.
_col
,
13883
Debug.Assert(_selectedBandIndexes.Contains(hti.
_col
));
13884
SetSelectedColumnCore(hti.
_col
, false);
14126
Debug.Assert(hti.
_col
>= 0);
14129
if (_ptCurrentCell.X != -1 && hti.
_col
!= _ptCurrentCell.X && !CommitEditForOperation(hti.
_col
, _ptCurrentCell.Y, true))
14135
if (IsColumnOutOfBounds(hti.
_col
))
14143
if (_trackColumnEdge >= 0 && (Columns.DisplayInOrder(_trackColumn, _trackColumnEdge) || _trackColumnEdge == _trackColumn) && Columns.DisplayInOrder(_trackColumnEdge, hti.
_col
))
14147
SelectColumnRange(dataGridViewColumn.Index, hti.
_col
, true);
14148
_trackColumnEdge = hti.
_col
;
14150
else if (_trackColumnEdge >= 0 && Columns.DisplayInOrder(_trackColumn, _trackColumnEdge) && Columns.DisplayInOrder(hti.
_col
, _trackColumnEdge) && (Columns.DisplayInOrder(_trackColumn, hti.
_col
) || hti.
_col
== _trackColumn))
14152
DataGridViewColumn? dataGridViewColumn = Columns.GetNextColumn(Columns[hti.
_col
], DataGridViewElementStates.Visible, DataGridViewElementStates.None);
14155
_trackColumnEdge = hti.
_col
;
14157
else if (_trackColumnEdge == -1 && Columns.DisplayInOrder(_trackColumn, hti.
_col
))
14161
SelectColumnRange(dataGridViewColumn.Index, hti.
_col
, true);
14162
_trackColumnEdge = hti.
_col
;
14164
else if (_trackColumnEdge >= 0 && (Columns.DisplayInOrder(_trackColumnEdge, _trackColumn) || _trackColumnEdge == _trackColumn) && Columns.DisplayInOrder(hti.
_col
, _trackColumnEdge))
14168
SelectColumnRange(hti.
_col
, dataGridViewColumn.Index, true);
14169
_trackColumnEdge = hti.
_col
;
14171
else if (_trackColumnEdge >= 0 && Columns.DisplayInOrder(_trackColumnEdge, _trackColumn) && Columns.DisplayInOrder(_trackColumnEdge, hti.
_col
) && (Columns.DisplayInOrder(hti.
_col
, _trackColumn) || hti.
_col
== _trackColumn))
14173
DataGridViewColumn? dataGridViewColumn = Columns.GetPreviousColumn(Columns[hti.
_col
], DataGridViewElementStates.Visible, DataGridViewElementStates.None);
14176
_trackColumnEdge = hti.
_col
;
14178
else if (_trackColumnEdge == -1 && Columns.DisplayInOrder(hti.
_col
, _trackColumn))
14182
SelectColumnRange(hti.
_col
, dataGridViewColumn.Index, true);
14183
_trackColumnEdge = hti.
_col
;
14185
else if (_trackColumnEdge >= 0 && Columns.DisplayInOrder(_trackColumn, _trackColumnEdge) && Columns.DisplayInOrder(hti.
_col
, _trackColumn))
14192
SelectColumnRange(hti.
_col
, dataGridViewColumn.Index, true);
14193
_trackColumnEdge = hti.
_col
;
14195
else if (_trackColumnEdge >= 0 && Columns.DisplayInOrder(_trackColumn, hti.
_col
) && Columns.DisplayInOrder(_trackColumnEdge, _trackColumn))
14202
SelectColumnRange(dataGridViewColumn.Index, hti.
_col
, true);
14203
_trackColumnEdge = hti.
_col
;
14211
if (_ptCurrentCell.X != -1 && hti.
_col
!= _ptCurrentCell.X)
14213
if (_ptCurrentCell.Y == -1 || IsColumnOutOfBounds(hti.
_col
))
14219
hti.
_col
,
14952
OnCellDoubleClick(new DataGridViewCellEventArgs(hti.
_col
, hti._row));
15873
if (_ptMouseDownCell.X == hti.
_col
15888
mouseX += ((hti.
_col
== -1) ? RowHeadersWidth : Columns[hti.
_col
].Thickness);
15891
dgvcme = new DataGridViewCellMouseEventArgs(hti.
_col
, hti._row, mouseX, e.Y - hti.RowY, e);
15895
OnCellClick(new DataGridViewCellEventArgs(hti.
_col
, hti._row));
15962
if (_ptMouseDownCell.X == hti.
_col
&& _ptMouseDownCell.Y == hti._row)
15972
mouseX += ((hti.
_col
== -1) ? RowHeadersWidth : Columns[hti.
_col
].Thickness);
15975
dgvcme = new DataGridViewCellMouseEventArgs(hti.
_col
, hti._row, mouseX, e.Y - hti.RowY, e);
16000
int columnIndex = (hti._typeInternal == DataGridViewHitTestTypeInternal.ColumnResizeRight) ? hti.
_col
: hti._adjacentCol;
16118
_ptMouseDownCell.X = hti.
_col
;
16124
mouseX += ((hti.
_col
== -1) ? RowHeadersWidth : Columns[hti.
_col
].Thickness);
16127
DataGridViewCellMouseEventArgs dgvcme = new(hti.
_col
, hti._row, mouseX, e.Y - hti.RowY, e);
16310
if (_dataGridViewOper[OperationTrackColSelect] && hti.
_col
>= 0)
16318
else if (_dataGridViewOper[OperationTrackCellSelect] && hti.
_col
>= 0 && hti._row >= 0)
16358
mouseX += ((hti.
_col
== -1) ? RowHeadersWidth : Columns[hti.
_col
].Thickness);
16365
dgvcme = new DataGridViewCellMouseEventArgs(hti.
_col
, hti._row, mouseX, e.Y - hti.RowY, meTmp);
16369
dgvcme = new DataGridViewCellMouseEventArgs(hti.
_col
, hti._row, mouseX, e.Y - hti.RowY, e);
16372
if (hti.
_col
>= 0
16373
&& _ptMouseDownCell.X == hti.
_col
16436
mouseX += ((hti.
_col
== -1) ? RowHeadersWidth : Columns[hti.
_col
].Thickness);
16439
OnCellMouseUp(new DataGridViewCellMouseEventArgs(hti.
_col
, hti._row, mouseX, e.Y - hti.RowY, e));
29164
if (_ptMouseEnteredCell.X != htiToUse.
_col
|| _ptMouseEnteredCell.Y != htiToUse._row)
29176
dgvce = new DataGridViewCellEventArgs(htiToUse.
_col
, htiToUse._row);
29185
mouseX += ((htiToUse.
_col
== -1) ? RowHeadersWidth : Columns[htiToUse.
_col
].Thickness);
29188
DataGridViewCellMouseEventArgs dgvcme = new(htiToUse.
_col
, htiToUse._row, mouseX, e.Y - htiToUse.RowY, e);
29894
if (hti.
_col
>= 0 && hti._row >= 0)
29906
else if (_dataGridViewOper[OperationTrackCellSelect] && hti.
_col
>= 0 && hti._row >= 0)
29980
dataGridViewCell = Rows.SharedRow(hti._row).Cells[hti.
_col
];
29984
dataGridViewCell = Columns[hti.
_col
].HeaderCell;
29987
Debug.Assert(hti.
_col
== -1);
29992
Debug.Assert(hti.
_col
== -1);