First row of datagridview remains selected +vb.net

RIAS
RIAS used Ask the Experts™
on
Hi,
First row of grid is selected as son as the tab index is changed.I have used the code on form load
dg.clearselection and also dg.rows(0).selected=false.But as soon as the I change tabs and the grid on tab2 still has the first row selected.But it works for first grid on tabpage0

Cheers
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Use RegEx to replace all characters that do not match alphanumeric characters with an empty string.
I think it should be something like attached code.

stringToCleanUp = Regex.Replace(stringToCleanUp, "[^a-zA-Z0-9]", "")

Open in new window

Commented:
Oops, sorry. Posted to wrong question. Ignore :)
 

Author

Commented:
Any suggestions?
You need to write the same code in for the 2nd grind in 2nd tab in tabindex change event of Tab

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial