The most important thing for me is to get the index of the row on which the button was clicked.please try to reply. I am trying to fill a 2nd grid view using input parameters including data from the 1st grid view rows using a stored procedure when the button in that row is clicked. I got a string object conversion when with the following lineint current Row Index = Int32. Command Argument); The fix is as below and then worked fine. Text = "Product ID: " & Product ID End Sub The code did not work.. I fixed the syntax mistakes and it didnt work still. Now how do you get the those buttons to display data when clicked? Basically I have tried to make the normal Add (Insert), Edit, Update and delete functions in ASP.Net Grid View simple and also combining the powers of ASP.Each column represents a field, while each row represents a record.The Grid View control supports the following features:use Row Editing, Row Updating, Row Deleting, Row Command, Row Data Bound, Row Canceling Edit, and Pagination in a Data Grid.
column which will act as custom column for delete functionality.
You can hide a Command Field or Button Field based on the position (index) in the Grid View.
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.
If it is expensive, this could easily sum up to a large cost. In this example, I am hiding it if the field "Scenario" of the grid shows the text "Actual" for the relevant row of the Row Data Bound event.
I almost gave up and just convert my commandfield to a templatefield but I know it can be done so I keep on searching for it. (Although I'm still not sure what the asker meant about the declarative answer.) If this was based on roles you could use the multiview panel but not sure if you could do the same against a property of the record. In your rowdatabound event you can hide or show the button in it.