In the Row Updating event handler, it fetches the Category Name data to which the textbox is bound to. Try something the gridview is bound to in your case Product [email protected] Vijay : I agree that its bad idea to enable any Id to be editable, but before going to my module i just create one table containing Prod ID and prod Name. Note: Instead of using Text Box in normal mode use Labels.
I've a sample below, the Grid View Template is bound to Category Name.
On Row Updating is fired when the 'Edit' button is clicked. Is the data bound to the gridview, your gridview markup doesn't say that it is bound to Category Name.
The Grid View 'Grid View1' fired event Sorting which wasn't handled.
The Grid View 'Grid View1' fired event Row Deleting which wasn't handled. When I say manually databinding I mean not using a data source control specified as a Data Source ID, but rather setting the Grid View’s Data Source equal to the appropriate data object and calling Data Bind. NET 2.0 are familiar with how to deal with this, but since ASP.
We’ll start with binding data to the Grid View, then build up functionality from there.
First, we’ll implement a method to databind the Grid View, which will be called whenever databinding needs to be performed.Since it’s a Bound Field, the Text Box is going to be Control.Once we have a reference to the Text Box, we set the new first name.The important point is not which of these two events call Bind Data, but one of them must or the Grid View will not be updated. When bound using a Data Source ID, the Grid View internally tracks the current Sort Expression and Sort Direction, and those are available through properties with the same names.When you manually bind the Grid View, this tracking does not occur, so we must implement some mechanism for tracking those values.After specifying the query, we add the appropriate sorting. When you bind a Grid View through a Data Source ID, the Grid View will update this value since it is internally tracking the sort expression, so it knows when to switch between ascending and descending.