Bind the GridView Control using VB.Net code to display the data items and implement the Select Command functionality on the ASP.net web page. GridView CommandField provides the automated functionality to execute the Select command and change the appearance of the selected row item.
Select Method Used
We have used the GridView Control's CommandField in this sample to execute the select command automatically.
Templates Used
1. CommandField
2. SelectedRowStyle
There is one another alternate to create the similar functionality by using the SelectedIndexChanged event of the ASP.Net GridView control. It provides the access to the NewSelectedIndex property of the gridview control that enables you to get or set the current row item of the GridView control as a selected row item. You can get its VB.Net code from the links provided at top and bottom of this sample.
Try the sample below to understand the functionality of GridView Select Row item that changes the appearance of the selected row: