I have a raddataform (2014 Q3), and I'm using the ItemUpdating event to run my custom update code (I update a few tables separately); it's working just fine. What I want to do is have the form return to "View" mode after a successful update. I'm sure it's a simple thing but it just stays in "Edit" mode even after a successful update. I have to click "Cancel" to get back to the View Template.
How can I make this work as expected? This has to be me just missing something amazingly simple.
Thanks!!
Amy
7 Answers, 1 is accepted
I would suggest you to review the online demo below that demonstrates the required functionality:
http://demos.telerik.com/aspnet-ajax/dataform/data-editing/manual-crud-operations/defaultcs.aspx
Give it a test and see if it works for you.
Regards,
Maria Ilieva
Telerik
Thanks Maria, but that is the first place I looked.
I am not using the same functionality as in the demo. I have to manually add items to the "newValues" hashtable and am not using the same sort of data access anyway. I do not want to fully re-code a complex page with a grid, a six-pageview multipage, and dataforms.
Are you saying that there is NO WAY to *manually* tell the dataform to go back to View mode after updating?
Thanks but as I stated I don't do the update in that way using a data table, I have to use SqlCommand objects instead.
Do I need to go through this whole operation, to manually create and then access a datarow all to just simply call cancelEdit?
Generally when the data editing ends the DataForm should automatically back to the view mode. In case this is not happening for your application this means that there are some issue in the logic you are using. It will be best if you can send us your page markup as well as the related code behind so that we can revise this logic and advise you further.
Meanwhile you can try to access the DataItem and use its "Edit" property by setting it to "false" and see if this covers your requirements.
Regards,
Maria Ilieva
Telerik
I understand that is how it is supposed to work normally, and that my codebehind was changing the behavior. What I was looking for, was not clearly stated in the documentation as I read it.
"access the DataItem and use its "Edit" property by setting it to "false""
That's exactly what I wanted to know, Maria. Thank you.