Getting the new value in gridview rowupdating event

07 Feb

If we move our mouse on to the variables, which hold the cell values, we can see the old value instead of new updated value (Refer the debugging Screen Shot at the Top).

Brad Foley Web Developer remember to click “Mark as Answer” on the post that helps you. Yeah sure I've defeeated some of the sorting and filtering features once you've entered edit mode, so I've got some work to do to make it elegant again.

There must be something fundamentally wrong that some of us are doing that is causing this and the fact that it's not happening to others, and they don't know the solution. this only works when the databind happends after the updating. hehe, don't worry man with you'll have job security.

If i move the databind to load (which fires before the Row Updating) it ceases to work correctly, and the newvalues are null. The pattern for not using a datasource (which i'd like to know why you aren't) is: Page_Load() Row Updating() Row Deleting() Sorting() etc.

"test" will appear in label not "asd" as I would want to.

A Grid View Update Event Args object is passed to the event-handling method, which enables you to determine the index of the current row and to indicate that the update operation should be canceled.

This is all started from the Data Tutorial series found on the website. tabid=63 Maybe I should look into using the Get Products method with an Object Data Source and see how that works. Now I can get the Bound Field newvalues with no problem in the Row Updating event.

I've deleted the datasource and gridview and started again from scratch, but I still get the same problem.

I have the following code below in my Grid View1_Row Updating event. Maybe after midnight today, or sometime this weekend. When I go to configure the datasource for my Object Data Source, on my first screen where I designate the business object, my dropdownlist is blank. Turns out getting the DAL, BLL, and the Object Data Souce in place, did the trick. Tracing the code, using both methods above, the value of the textbox is not being passed back; it doesn't appear in the newvalues either.

That probably needs to be linked into the Object Data Source along my Get Products, as well as the Add Products, and Delete Product methods. Problem is, I don't have the time at the moment yet. And back to my original question, how to I get the new value? I have a gridview, go into edit mode, enter a value in a textbox, then click update.