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)
9338
hti.
_col
= GetColumnIndexFromX(x, out int xColumnLeftEdge);
9478
hti.
_col
= GetColumnIndexFromX(x, out int xColumnLeftEdge);
12095
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)
3646
Debug.Assert(hti.
_col
!= -1);
3650
int xColumnLeftEdge = GetColumnXFromIndex(hti.
_col
);
3651
int wColumn = Columns[hti.
_col
].Width;
3656
previousColumnIndex = hti.
_col
;
3662
Columns[hti.
_col
],
3674
? hti.
_col
3688
&& !(previousColumnIndex == -1 && hti.
_col
== _trackColumn)
3697
Debug.Assert(hti.
_col
!= -1);
3698
if (hti.
_col
!= _trackColumn)
5760
mouseX += ((hti.
_col
== -1) ? RowHeadersWidth : Columns[hti.
_col
].Thickness);
5764
hti.
_col
,
5853
hti.
_col
,
8605
if (hti.
_col
>= 0)
8607
firstColumnIndex = hti.
_col
;
8690
&& hti.
_col
>= 0
8691
&& !Columns[hti.
_col
].Frozen)
9339
if (hti.
_col
< 0)
9344
Debug.Assert(xColumnLeftEdge == GetColumnXFromIndex(hti.
_col
));
9349
int columnWidth = Columns[hti.
_col
].Thickness;
9358
DataGridViewColumn dataGridViewColumn = Columns[hti.
_col
];
9370
Columns[hti.
_col
],
9480
if (hti.
_col
< 0 || hti._row < 0)
9485
Debug.Assert(xColumnLeftEdge == GetColumnXFromIndex(hti.
_col
));
9493
int columnWidth = Columns[hti.
_col
].Thickness;
9501
DataGridViewColumn dataGridViewColumn = Columns[hti.
_col
];
9515
if (hti.
_col
!= DisplayedBandsInfo.FirstDisplayedScrollingCol || DisplayedBandsInfo.LastTotallyDisplayedScrollingCol >= 0)
9517
dataGridViewColumn = Columns.GetPreviousColumn(Columns[hti.
_col
],
9553
if (hti.
_col
== dataGridViewColumn.Index
9643
if (hti.
_col
>= 0)
9656
if (hti.
_col
>= 0 && hti._row >= 0)
9664
if (_dataGridViewOper[OperationTrackColSelect] && hti.
_col
>= 0)
9668
else if (_dataGridViewOper[OperationTrackCellSelect] && hti.
_col
>= 0 && hti._row >= 0)
11906
Debug.Assert(_ptMouseDownCell.X == hti.
_col
);
11954
int columnIndex = (hti._typeInternal == DataGridViewHitTestTypeInternal.ColumnResizeRight) ? hti.
_col
: hti._adjacentCol;
11987
BeginColumnRelocation(ptGridCoord.X, hti.
_col
);
12065
if (_ptCurrentCell.X >= 0 && (_ptCurrentCell.X != hti.
_col
|| _ptCurrentCell.Y != hti._row))
12070
forCurrentCellChange: _ptCurrentCell.X != hti.
_col
|| _ptCurrentCell.Y != hti._row,
12085
if (hti.
_col
>= Columns.Count)
12129
&& IsSharedCellSelected(Rows.SharedRow(hti._row).Cells[hti.
_col
], hti._row)
12140
RemoveIndividuallySelectedCells(hti.
_col
, hti._row);
12162
hti.
_col
,
12169
SetSelectedCellCore(hti.
_col
, hti._row, selected: true);
12174
SetSelectedCellCore(hti.
_col
, hti._row, selected: true);
12179
SetSelectedCellCore(hti.
_col
, hti._row, selected: false);
12183
hti.
_col
,
12194
if (isControlDown && Columns[hti.
_col
].Selected)
12202
_trackColumn = hti.
_col
;
12224
if (_selectedBandIndexes[bandIndex] != hti.
_col
)
12251
if (Columns.DisplayInOrder(_ptAnchorCell.X, hti.
_col
))
12253
SelectColumnRange(_ptAnchorCell.X, hti.
_col
, true);
12257
SelectColumnRange(hti.
_col
, _ptAnchorCell.X, true);
12260
else if (!_selectedBandIndexes.Contains(hti.
_col
))
12262
SetSelectedColumnCore(hti.
_col
, true);
12267
Debug.Assert(_selectedBandIndexes.Contains(hti.
_col
));
12268
SetSelectedColumnCore(hti.
_col
, false);
12272
hti.
_col
,
12284
&& (Columns[hti.
_col
].Selected || IsSharedCellSelected(Rows.SharedRow(hti._row).Cells[hti.
_col
], hti._row))
12304
SetSelectedCellCore(hti.
_col
, hti._row, true);
12324
RemoveIndividuallySelectedCells(hti.
_col
, hti._row);
12352
hti.
_col
,
12359
SetSelectedCellCore(hti.
_col
, hti._row, true);
12374
SetSelectedCellCore(hti.
_col
, hti._row, false);
12379
SetSelectedCellCore(hti.
_col
, hti._row, false);
12384
hti.
_col
,
12477
hti.
_col
,
12490
|| IsSharedCellSelected(Rows.SharedRow(hti._row).Cells[hti.
_col
], hti._row))
12510
SetSelectedCellCore(hti.
_col
, hti._row, true);
12530
RemoveIndividuallySelectedCells(hti.
_col
, hti._row);
12558
hti.
_col
,
12565
SetSelectedCellCore(hti.
_col
, hti._row, selected: true);
12580
SetSelectedCellCore(hti.
_col
, hti._row, selected: false);
12585
SetSelectedCellCore(hti.
_col
, hti._row, false);
12590
hti.
_col
,
12764
if ((hti.
_col
!= _ptCurrentCell.X || hti._row != _ptCurrentCell.Y)
12765
&& !CommitEditForOperation(hti.
_col
, hti._row, forCurrentCellChange: true))
12774
if (_ptAnchorCell.X == -1 || IsInnerCellOutOfBounds(hti.
_col
, hti._row))
12782
hti.
_col
,
12787
if (hti.
_col
!= _ptCurrentCell.X || hti._row != _ptCurrentCell.Y)
12790
hti.
_col
,
13689
if (isControlDown && Columns[hti.
_col
].Selected)
13697
if (rowIndex > -1 && hti.
_col
!= _ptCurrentCell.X)
13758
if (IsColumnOutOfBounds(hti.
_col
))
13764
_trackColumn = hti.
_col
;
13786
if (_selectedBandIndexes[bandIndex] != hti.
_col
)
13822
if (Columns.DisplayInOrder(_ptAnchorCell.X, hti.
_col
))
13824
SelectColumnRange(_ptAnchorCell.X, hti.
_col
, true);
13828
SelectColumnRange(hti.
_col
, _ptAnchorCell.X, true);
13831
else if (!_selectedBandIndexes.Contains(hti.
_col
))
13833
SetSelectedColumnCore(hti.
_col
, true);
13839
if (hti.
_col
!= _ptCurrentCell.X)
13841
if (IsInnerCellOutOfBounds(hti.
_col
, rowIndex))
13846
bool success = ScrollIntoView(hti.
_col
, rowIndex, forCurrentCellChange: false);
13848
if (IsInnerCellOutOfBounds(hti.
_col
, rowIndex))
13854
hti.
_col
,
13880
Debug.Assert(_selectedBandIndexes.Contains(hti.
_col
));
13881
SetSelectedColumnCore(hti.
_col
, false);
14123
Debug.Assert(hti.
_col
>= 0);
14126
if (_ptCurrentCell.X != -1 && hti.
_col
!= _ptCurrentCell.X && !CommitEditForOperation(hti.
_col
, _ptCurrentCell.Y, true))
14132
if (IsColumnOutOfBounds(hti.
_col
))
14140
if (_trackColumnEdge >= 0 && (Columns.DisplayInOrder(_trackColumn, _trackColumnEdge) || _trackColumnEdge == _trackColumn) && Columns.DisplayInOrder(_trackColumnEdge, hti.
_col
))
14144
SelectColumnRange(dataGridViewColumn.Index, hti.
_col
, true);
14145
_trackColumnEdge = hti.
_col
;
14147
else if (_trackColumnEdge >= 0 && Columns.DisplayInOrder(_trackColumn, _trackColumnEdge) && Columns.DisplayInOrder(hti.
_col
, _trackColumnEdge) && (Columns.DisplayInOrder(_trackColumn, hti.
_col
) || hti.
_col
== _trackColumn))
14149
DataGridViewColumn? dataGridViewColumn = Columns.GetNextColumn(Columns[hti.
_col
], DataGridViewElementStates.Visible, DataGridViewElementStates.None);
14152
_trackColumnEdge = hti.
_col
;
14154
else if (_trackColumnEdge == -1 && Columns.DisplayInOrder(_trackColumn, hti.
_col
))
14158
SelectColumnRange(dataGridViewColumn.Index, hti.
_col
, true);
14159
_trackColumnEdge = hti.
_col
;
14161
else if (_trackColumnEdge >= 0 && (Columns.DisplayInOrder(_trackColumnEdge, _trackColumn) || _trackColumnEdge == _trackColumn) && Columns.DisplayInOrder(hti.
_col
, _trackColumnEdge))
14165
SelectColumnRange(hti.
_col
, dataGridViewColumn.Index, true);
14166
_trackColumnEdge = hti.
_col
;
14168
else if (_trackColumnEdge >= 0 && Columns.DisplayInOrder(_trackColumnEdge, _trackColumn) && Columns.DisplayInOrder(_trackColumnEdge, hti.
_col
) && (Columns.DisplayInOrder(hti.
_col
, _trackColumn) || hti.
_col
== _trackColumn))
14170
DataGridViewColumn? dataGridViewColumn = Columns.GetPreviousColumn(Columns[hti.
_col
], DataGridViewElementStates.Visible, DataGridViewElementStates.None);
14173
_trackColumnEdge = hti.
_col
;
14175
else if (_trackColumnEdge == -1 && Columns.DisplayInOrder(hti.
_col
, _trackColumn))
14179
SelectColumnRange(hti.
_col
, dataGridViewColumn.Index, true);
14180
_trackColumnEdge = hti.
_col
;
14182
else if (_trackColumnEdge >= 0 && Columns.DisplayInOrder(_trackColumn, _trackColumnEdge) && Columns.DisplayInOrder(hti.
_col
, _trackColumn))
14189
SelectColumnRange(hti.
_col
, dataGridViewColumn.Index, true);
14190
_trackColumnEdge = hti.
_col
;
14192
else if (_trackColumnEdge >= 0 && Columns.DisplayInOrder(_trackColumn, hti.
_col
) && Columns.DisplayInOrder(_trackColumnEdge, _trackColumn))
14199
SelectColumnRange(dataGridViewColumn.Index, hti.
_col
, true);
14200
_trackColumnEdge = hti.
_col
;
14208
if (_ptCurrentCell.X != -1 && hti.
_col
!= _ptCurrentCell.X)
14210
if (_ptCurrentCell.Y == -1 || IsColumnOutOfBounds(hti.
_col
))
14216
hti.
_col
,
14949
OnCellDoubleClick(new DataGridViewCellEventArgs(hti.
_col
, hti._row));
15870
if (_ptMouseDownCell.X == hti.
_col
15885
mouseX += ((hti.
_col
== -1) ? RowHeadersWidth : Columns[hti.
_col
].Thickness);
15888
dgvcme = new DataGridViewCellMouseEventArgs(hti.
_col
, hti._row, mouseX, e.Y - hti.RowY, e);
15892
OnCellClick(new DataGridViewCellEventArgs(hti.
_col
, hti._row));
15959
if (_ptMouseDownCell.X == hti.
_col
&& _ptMouseDownCell.Y == hti._row)
15969
mouseX += ((hti.
_col
== -1) ? RowHeadersWidth : Columns[hti.
_col
].Thickness);
15972
dgvcme = new DataGridViewCellMouseEventArgs(hti.
_col
, hti._row, mouseX, e.Y - hti.RowY, e);
15997
int columnIndex = (hti._typeInternal == DataGridViewHitTestTypeInternal.ColumnResizeRight) ? hti.
_col
: hti._adjacentCol;
16115
_ptMouseDownCell.X = hti.
_col
;
16121
mouseX += ((hti.
_col
== -1) ? RowHeadersWidth : Columns[hti.
_col
].Thickness);
16124
DataGridViewCellMouseEventArgs dgvcme = new(hti.
_col
, hti._row, mouseX, e.Y - hti.RowY, e);
16307
if (_dataGridViewOper[OperationTrackColSelect] && hti.
_col
>= 0)
16315
else if (_dataGridViewOper[OperationTrackCellSelect] && hti.
_col
>= 0 && hti._row >= 0)
16355
mouseX += ((hti.
_col
== -1) ? RowHeadersWidth : Columns[hti.
_col
].Thickness);
16362
dgvcme = new DataGridViewCellMouseEventArgs(hti.
_col
, hti._row, mouseX, e.Y - hti.RowY, meTmp);
16366
dgvcme = new DataGridViewCellMouseEventArgs(hti.
_col
, hti._row, mouseX, e.Y - hti.RowY, e);
16369
if (hti.
_col
>= 0
16370
&& _ptMouseDownCell.X == hti.
_col
16433
mouseX += ((hti.
_col
== -1) ? RowHeadersWidth : Columns[hti.
_col
].Thickness);
16436
OnCellMouseUp(new DataGridViewCellMouseEventArgs(hti.
_col
, hti._row, mouseX, e.Y - hti.RowY, e));
29161
if (_ptMouseEnteredCell.X != htiToUse.
_col
|| _ptMouseEnteredCell.Y != htiToUse._row)
29173
dgvce = new DataGridViewCellEventArgs(htiToUse.
_col
, htiToUse._row);
29182
mouseX += ((htiToUse.
_col
== -1) ? RowHeadersWidth : Columns[htiToUse.
_col
].Thickness);
29185
DataGridViewCellMouseEventArgs dgvcme = new(htiToUse.
_col
, htiToUse._row, mouseX, e.Y - htiToUse.RowY, e);
29891
if (hti.
_col
>= 0 && hti._row >= 0)
29903
else if (_dataGridViewOper[OperationTrackCellSelect] && hti.
_col
>= 0 && hti._row >= 0)
29977
dataGridViewCell = Rows.SharedRow(hti._row).Cells[hti.
_col
];
29981
dataGridViewCell = Columns[hti.
_col
].HeaderCell;
29984
Debug.Assert(hti.
_col
== -1);
29989
Debug.Assert(hti.
_col
== -1);