Eventhough, I get the error "The Grid View 'Grid View2' fired event Row Editing which wasn't handled"... I tried in google, I'm unable to get right answer..suggest to create a method that would handle Row Editing event....
Hi there, Edit and Delete command names are reserved names and will trigger the events mentioned that your code isn't handling.
This is becoming so frustrating it's getting almost comical. Breakpoints were triggered for the Row Editing and Row Command.
David I suggested that the Row Updating function was being blocked by the . Data Bind() in the Row Command event so that only the Edit command will activate it (take it out of Row Editing). Twice for Row Command (1 for Row Editing and 1 for Row Canceling) and once for Row Editing. I am going to try and create this not as a web application but rather as a website and see if I notice any differences.
To get the Primary Key reference we can use the Data Keys collection of the Grid View.
This collection only requires the row index no and it will give us the primary key.
In data driven web sites, users are normally allowed to view data and administrators are allowed to add, edit or delete data.
In this tutorial I will show you how you can create an editable Grid View control for administrators to modify database records directly into the Grid View control.
Please keep in mind that there are many different ways to update the database using the Grid View control depending on the type of data you are updating and the functionality the user need and there are many solutions to achieve the same end result.
Editing the Grid View control can be an incredibly easy feature to add for certain database tables, especially those who have no foreign key associated and can easily be edited through the use of a standard Text Box web control as shown in the figure below: Before we start examining the ASP.
NET Grid View markup and associated code lets first enumerate the important code pieces of this tutorial.
Data Bind() in Row Editing, I said nothing about what might happen if you removed it. Then set your breakpoints in Row Command, Row Editing, and Row Updating and we'll see what happens. David OK, I'm offically out of bullets, at least for now. If I get some time, I'll see if I can duplicate this, but I'm suspecting there's something out there that neither of us have looked at yet.
I subsequently changed the code behind to explicitly bind to the product table during Row Cancel and Row Edit events.