Rowupdating getting old values
NET Grid View markup and associated code lets first enumerate the important code pieces of this tutorial. Today I was working on getting a row of the Grid View control to save the contents of a Drop Down List, and needed to add some custom code to set.In the above code, I set two properties Show Edit Button and Show Cancel Button of Command Field. the good old problem of getting the data from the row that is being currently edited within a Grid View. You add following line in Row Updating event handler the Row Updated event will not get triggered.Everything is working fine, but the Grid View is Updating the Database with the Value that is already there instead of the new one that is entered into the Edit Textbox.I've been staring at this for a whole day and can't figure anything out. So what you need to do is store the data source (maybe in Session) and only bind rebind the data when you absolutely need to (Like during the Is Not Post Back) Do you understand? Please post the code for your Page_Load method and the that handles your Update (your C# code) so we can have a better look at what's going on. Please give some references and/or details of how to. This wipes out the data provided by the user during editing (editing happens after the page load).
Going into that code we are trying to get the primary key of the employee table Employee ID by using Grid View Data Key Names and then pass the Query to the Bind Grid Data method to bind the updated. Text Dim command As Sql Command = New Sql Command("updatetest", cn) command. Add With Value("@pfirstname", str Last Name) If cn. Please help me with writing a Row Updating function in C#, I don't know how to grab the current field's value and also get the old value for one of keys (which is Project Name for editing) of the selected row. the idea wa to don't allow binding the grid view after a post back. hello my problem was that my gridview editable controls heep their old values. this is due to the grid view binding in the page_load method after every post back.