After update

8 posts, 0 answers
  1. Amy
    Amy avatar
    7 posts
    Member since:
    Oct 2011

    Posted 14 Apr 2015 Link to this post

    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

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 17 Apr 2015 Link to this post

    Hello Amy,

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Amy
    Amy avatar
    7 posts
    Member since:
    Oct 2011

    Posted 17 Apr 2015 in reply to Maria Ilieva Link to this post

    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? 

  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 22 Apr 2015 Link to this post

    Hi,

    After manually update the "newValues"  hash table you can call "CancelEdit()" for the updated DataRow, that is also demonstrated in the presented demo.This will bring the DataForm to view mode again.

    Regards,
    Maria Ilieva
    Telerik
  6. Amy
    Amy avatar
    7 posts
    Member since:
    Oct 2011

    Posted 22 Apr 2015 in reply to Maria Ilieva Link to this post

    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?

     

     

  7. Amy
    Amy avatar
    7 posts
    Member since:
    Oct 2011

    Posted 22 Apr 2015 in reply to Amy Link to this post

    (All I mean is, having this operation available from the data form itself would be much, MUCH simpler)
  8. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 27 Apr 2015 Link to this post

    Hi Amy,

    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
  9. Amy
    Amy avatar
    7 posts
    Member since:
    Oct 2011

    Posted 27 Apr 2015 in reply to Maria Ilieva Link to this post

    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.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017