I need to get the the highest ColumnIndex among SelectedCells in a DataGridView.
int i = theHighestColumnIndexAmongSelectedCells.
Or
foreach (DataGridViewCell cell in dgv.SelectedCells)
if cell.ColumnIndex is theHighest
int i = cell.ColumnIndex.
How might I do this?
The easiest way it to use the LINQ Max() function: