Gridview rowupdating commandname unsuccessful dating

Posted by / 07-Nov-2020 23:31

Gridview rowupdating commandname

So rather than getting the bound item directly, I have to retrieve the grid Row's Data Item index, then use that index and retrieve the value from the original data source.

At that point I have the data I need to be on my way and do my business logic (which in this case is very simple).

Dear All, In Row Updating event of a Grid View I am trying to update the database picking the values of bound text Boxes in the Edit Item Templates. I confirmed update works by giving some other text vlaues instead of those retrieved from TB1, TB2, and TB3. I checked your code, it is working very good; below example of the code I used here...

But Values retrieved from the tex Boxes are old values (not the newly typed in values in Edit mode) So in effect no updating is happening.

Although the Grid View Command Event Args have a Data Item member that member is unfortunately not set with the Data Row as you would maybe expect. Page //default1Dear Karthicks Thank you very much for pointing it out.. ' I am marking this also as answer,,let other less understanding guys like me benefit..In Code Behind you have to do a bit of work though if you want to retrieve the proper context from a Data Item.Here's some code that needs to retrieve a Pk of one of the bound items and then perform some work on the data (in this case the business object): This seems like a lot of code to have to write just to retrieve data context.

gridview rowupdating commandname-86gridview rowupdating commandname-84gridview rowupdating commandname-38

One thought on “gridview rowupdating commandname”