Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Highlight selected row in a GridView
Message
From
03/09/2008 04:30:25
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01344194
Message ID:
01344404
Views:
14
>I have a Link ButtonField in my GridControl control displaying total umber of orders for a specific category. When user clicks on the link I would like to highlight his/her selection by changing the row's BackColor property.
>
>So, in the GridView_RowCommand I put the following whcih works with the exception of clearing BackCOlor of previously selected record:
>
>
>Select Case e.CommandName
>            Case "ItemCount"
>               ''clear currently selected row
>               gvStats.RowStyle.BackColor = Drawing.Color.White
>
>               ''highlight selected record
>                gvStats.Rows(intRow).BackColor = Drawing.Color.Yellow
>End Select
>
Hi Daniel,

its not necessary to set the backgroundcolor manually in the RowCommand event of the grid.
If you have a linkbutton, just set its CommandName property to "Select" and the grid will follow the normal Select/Unselect action.
Holger Vorberg
Germany
Previous
Reply
Map
View

Click here to load this message in the networking platform