For example you could have the following code:to store the information. Finally the code is bound to the When the user selects a record from the grid, the selected row index will be passed through as the Command Argument.Run the project and place a breakpoint on the code above. The program will stop on the breakpoint and you will be able to see the selected row index being passed through.In the following tutorial, I will show you different techniques you can use to display command buttons in Grid View. Command Name Dim current Row Index As Integer = Int32. For this tutorial I am using Microsoft famous sample database Northwind. Also make sure you are setting Grid View Data Key Fields property to the Primary Key column of the Product Table such as Product ID. Text = total End Sub Conditional and Logical Operators in Visual Basic . NETLogin Tutorial Using Access Database - Visual Basic . NET to My Sql Database Read (Lookup) records from Access Database - Visual Basic . NET Placing Controls on Form Hangman Tutorial - Page 1 - Visual Basic .
Following code will show you how you can get Row Index, Product ID and Command Name of the button when user click any button in the Grid View. You can find the textbox that is generated on edit event in the Row Updating event below and assign it to a string variable.Then have a seperate function to update the values entered and finally call your Bind Grid() function which again binds the gridview..From the following chapters you can see some important operations in ASP. This example shows how to edit and update records in a Grid View in ASP. This example is helpful in situations where an administrator needs to edit several records from the database.