Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.NET 2010 and datagridview contrl

Status
Not open for further replies.

BlackKnight

Programmer
Oct 18, 2000
348
US
Hi,
I am using VB.NET 2010 and the datagridview control. When I set the selectionmode property to fullrowselect and the rows are displayed the first row is automatically highlighted.

I understand that this may be default behaviour for the datagridview control but is there a way to stop it? I don't want the first row to be auto highlighted.

I have checked the selectedrows, selectedcells, and selectedcolumns counts and they are all 0. I have tried deselecting rows before the datagridview is displayed but ir didn't work.

If you have any questions then please let me know.

Thanks,
BK
 
Nevermind...it seems tha this code works

if datgridview1.Rows.Count > 0 Then
datgridview1.Item(0, 0).Selected = False
end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top