Confirmation message before update or insert record

6 posts, 1 answers
  1. Kailash
    Kailash avatar
    6 posts
    Member since:
    Jun 2009

    Posted 15 Sep 2009 Link to this post

    Hi,

    I want to show confirmation message before user update or insert record using rad grid (Edit popup form).
    Confirmation message will be display when user click on insert or update button on the popup window.


    Please suggest me for this problem.






    Regards,
    Kailash
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Sep 2009 Link to this post

    Hi Kailash,

    One suggestion would be attaching the OnCommand event to RadGrid and cancel the command if confirmation returns false. The event can be canceled by using the method 'eventArgs.set_cancel(true)'.

    ASPX:
     
     . . . 
    <ClientSettings> 
        <ClientEvents OnCommand="OnCommand" /> 
    </ClientSettings> 
     . . . 

    JavaScript:
     
    <script type="text/javascript"
    function OnCommand(sender, args) 
        if(args.get_commandName() == 'Update' || args.get_commandName() == 'PerformInsert'
        { 
            if(!confirm ('Do you want to continue ?')) 
            { 
                args.set_cancel(true); //cancel the command 
            } 
        } 
    </script> 

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jon Ingersoll
    Jon Ingersoll avatar
    12 posts
    Member since:
    May 2009

    Posted 18 Mar 2011 Link to this post

    Is there a way to access the edit form values in the javascript pop up? Such that you could say something like:

    "Are you sure you want to set status to XXXXXX?" where XXXXXX is value in the status field of the radgrid edit form being submitted?
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Mar 2011 Link to this post

    Hello Jon,

    Give a try with the approach in the following forum post to get the edit/insert form cell values from client side.
    Getting the new data row in client side

    Thanks,
    Princy.
  6. Jon Ingersoll
    Jon Ingersoll avatar
    12 posts
    Member since:
    May 2009

    Posted 21 Mar 2011 Link to this post

    Princy,

    Thanks, that worked perfectly.

    -J
  7. Dion
    Dion  avatar
    2 posts
    Member since:
    Mar 2015

    Posted 28 Sep 2015 in reply to Shinu Link to this post

    Shinu said:Hi Kailash,

    One suggestion would be attaching the OnCommand event to RadGrid and cancel the command if confirmation returns false. The event can be canceled by using the method 'eventArgs.set_cancel(true)'.

    ASPX:
     
     . . . 
    <ClientSettings> 
        <ClientEvents OnCommand="OnCommand" /> 
    </ClientSettings> 
     . . . 

    JavaScript:
     
    <script type="text/javascript"
    function OnCommand(sender, args) 
        if(args.get_commandName() == 'Update' || args.get_commandName() == 'PerformInsert'
        { 
            if(!confirm ('Do you want to continue ?')) 
            { 
                args.set_cancel(true); //cancel the command 
            } 
        } 
    </script> 

    -Shinu.

     Shinu,

     I want to use radconfirm instead of browser confirm, how to do that?

     

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