datagridview

E

EricW

How do I prevent selection of the first row of a datagridview after binding?

rg,
Eric
 
J

Jack Jackson

How do I prevent selection of the first row of a datagridview after binding?

rg,
Eric

I have not found any good way to do this.

If the DataGridView has been displayed when you bind it, you can call
ClearSelections() after you bind it. If you do the binding early in
the process of loading the form, the binding may be delayed and
calling ClearSelections() won't help because the first row will be
selected later when the binding occurs.

Sorting the grid by clicking on a column will also cause the first row
to be selected if no row was previously selected.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top