The DataGridViewCellMouseEventArgs object provided in the events (eg CellMouseDown, CellDoubleClicked) gives the column as a numeric index in DataGridView.Columns but I don’t want to hardcode a number into my event handler. I’m using a strongly typed dataset and am wondering if there’s a way to find out what the column index for MyDataRowType.TheColumnImLookingFor in the DGV is programatically.
The DataGridViewCellMouseEventArgs object provided in the events (eg CellMouseDown, CellDoubleClicked) gives the column as
Share
You could do the following to get the matching column: