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

Confirmation message before update or insert record

5 Answers 1172 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kailash
Top achievements
Rank 2
Kailash asked on 15 Sep 2009, 01:55 PM
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

5 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 16 Sep 2009, 05:42 AM
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.
0
Jon Ingersoll
Top achievements
Rank 1
answered on 18 Mar 2011, 03:26 PM
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?
0
Princy
Top achievements
Rank 2
answered on 21 Mar 2011, 05:28 AM
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.
0
Jon Ingersoll
Top achievements
Rank 1
answered on 21 Mar 2011, 03:39 PM
Princy,

Thanks, that worked perfectly.

-J
0
Dion
Top achievements
Rank 1
answered on 28 Sep 2015, 09:38 AM
[quote]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. [/quote]

 Shinu,

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

 

Tags
Grid
Asked by
Kailash
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Jon Ingersoll
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Dion
Top achievements
Rank 1
Share this question
or