For example, I had <DataGridViewName>
SelectionAllowed is defined as a Boolean variable which I was set to true on a button click or when populating the DataGridView. This worked but had some issues.
Now I came up with a solution which, I think, would work for all property settings of the DataGridView. Mine has the following properties
MultiSelect = false
SelectionMode = FullRowSelect
What you need is
In VisibleChanged handler
That's it... nothing more.
Note: I have only tested this in my situation. It might not work in yours.