VB.Net GridView Select Row Item in ASP.Net

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:

 

ProductIDProduct NameUnits In StockPrice Per UnitSelect
1Chai3918.0000Select
2Chang1719.0000Select
3Aniseed Syrup1310.0000Select
4Chef Anton's Cajun Seasoning5322.0000Select
5Chef Anton's Gumbo Mix021.3500Select
6Grandma's Boysenberry Spread12025.0000Select
7Uncle Bob's Organic Dried Pears1530.0000Select
8Northwoods Cranberry Sauce640.0000Select
9Mishi Kobe Niku2997.0000Select
10Ikura3131.0000Select
  • HIRE EzineASP.Net Developers