This is a migrated thread and some comments may be shown as answers.

updatecommand need to get previous value

1 Answer 7 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Allen
Top achievements
Rank 1
Allen asked on 25 Sep 2013, 09:44 PM
I'm using batch edit and auto operation in my grid.  I need to get the previous values of the cells for the update command.
My update command is as follow:
UpdateCommand="BEGIN UPDATE "WFM_CAT_RECURRENCE_DT" SET "FROM_YEAR" = :FROM_YEAR, "FROM_WEEK" = :FROM_WEEK, "TO_YEAR" = :TO_YEAR, "TO_WEEK" = :TO_WEEK, "USERID" = :currUserID, "USERNAME" = :currUserName, "CREATE_DATE" = SYSDATE WHERE "DIVISION" = :DIVISION AND "DISTRICT" = :DISTRICT AND "LOCATION" = :LOCATION AND
"FROM_YEAR" = PREVIOUS_FROM_YEAR AND "FROM_WEEK" = PREVIOUS_FROM_WEEK AND "TO_YEAR" = PREVIOUS_TO_YEAR  AND "TO_WEEK" = PREVIOUS_TO_WEEK  
"USERID" = :USERID AND "USERNAME" = :USERNAME AND "CREATE_DATE" = :CREATE_DATE; exception when dup_val_on_index then null; End;">

I need to pass the previous cell value to PREVIOUS_FROM_YEAR,  PREVIOUS_FROM_WEEK,  PREVIOUS_TO_YEAR, PREVIOUS_TO_WEEK.  Can anyone tell me how to accomplish this?

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 30 Sep 2013, 01:07 PM
Hi Allen,

In order to obtain the old values you can subscribe to the OnItemCommand or OnBatchEditCommand events and extract them from the arguments as demonstrated here.

Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Allen
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or