user6392391
user6392391

Reputation:

Disable individual cell highlighting but allowing full row selection in DataGridView with Vb.Net

In my program, I have a DataGridView form and with it I want the user to select the whole row, but disable single cell selection.

I tried to handle the SelectionChanged event, checking to see if the selectedRows.Count is greater than zero, and if it is true clearing the selection and outputting a message. The issue is that the event gets fired more than once for each click.

Upvotes: 1

Views: 87

Answers (1)

APrough
APrough

Reputation: 2701

Change the SelectionMode of your DataGridView (in Properties) to FullRowSelect.

Upvotes: 0

Related Questions