I have DataGridView with about 5 columns and the last column is a DataGridViewLinkColumn type. So the requirement here is that I should be able to select any row I want and when I do that, all the columns should be selected except the last column in that selected row. As the last column contains a hyperlinked text and there are some functions written which are intended to run.
Currently I have set the selection mode to FullRowSelect.
To achieve the requirement I have tried to set the mode to CellSelect and in the CellContentClick I was setting 'Selected' property for the specific columns of a selected row. But the selection wasn't happening properly. It would disappear as soon as I click. Also I tried to put the same logic in CellMouseUp, but it did't work either.
Kindly suggest me ways or workarounds for achieving the requirement.
Many Thanks!
First set the
SelectionMode
toCellSelect
. Then code theSelectionChanged
event:Note that this makes no provisions for deselecting a row!