Popup Template trouble

2 posts, 0 answers
  1. Ed
    Ed avatar
    43 posts
    Member since:
    Dec 2019

    Posted 06 Feb 2020 Link to this post

    Hi,

    I am using a custom popup template to add and edit rows on the grid. I can add and modify rows just fine and everything stores to the db the way it's supposed to.

    However, I am finding that if I:

    1: add a new row via the template

    2. hit save,

    3. come back to the main grid from the popup template.

    4. immediately hit the EDIT button and go back to the template and correct a mistake.

    5. hit the save button on the template.

    when this sequence is followed the OnPostCreate gets called intead of OnPostUpdate.

    It's like it never got out of edit mode.

    If I refresh the grid by navigating someplace else and coming back all the data is correct. It's only in this rare instance.

    Any ideas?

    Thanks … Ed

     

     

  2. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1082 posts

    Posted 11 Feb 2020 Link to this post

    Hi, Ed,

    The described behavior is most likely to occur when the data source of the grid is not made aware that a new item was created because of the lack of or the format/content of the create operation response.

    The expected response for newly created items is that they are in the exact same format as the read action, one or more  dependent on the Batch() setting and having a unique id which is not of its default value for its type (0 for integer, empty string for string).

    • Can you share with us the grid data source and controller code?
    • Does the response meet the expectations when the create operation is called?
    • Does the custom popup navigate to another View or is it in the same view and using the built-in Update buttons?

    Look forward to hearing back from you.

    Kind Regards,
    Alex Hajigeorgieva
    Progress Telerik

    Get quickly onboarded and successful with Telerik UI for ASP.NET Core with the dedicated Virtual Classroom technical training, available to all active customers.
Back to Top