1. Click "OK" for the radtoolbar client implementation.
Add onclientbuttonclicking = "clientbuttonclicking" to radtoolbar"
Then confirm in the script
Function clientbuttonclicking (sender, argS)
{
If (ARGs. get_item (). get_text () = "Report ")
{
If (! Window. Confirm ("are you sure you want to report? The reported data cannot be modified! "))
{
Args. set_cancel (true );
}
}
}
2. radgrid implementation prompt on the client
Set in radgrid
<Clientsettings>
<Clientevents oncommand = "onclientbuttonclicking"/>
</Clientsettings>
Add script
<Telerik: radcodeblock id = "radcodeblock1" runat = "server">
<SCRIPT type = "text/JavaScript">
<! --
Function onclientbuttonclicking (sender, argS)
{
If (ARGs. get_commandname () = "delete ")
{
VaR grid = $ find ("<% = radgrid1.clientid %> ");
VaR view = $ find ("<% = radgrid1.mastertableview. clientid %> ");
VaR items = view. get_dataitems ();
VaR item = items [args. get_commandargument ()];
// Usercount must be the primary key. If usercount is not the primary key of the table, set clientdatakeynames in the grid as the composite primary key.
// For example, clientdatakeynames = "ID, usercount"
VaR usercount = item. getdatakeyvalue ("usercount ");
If (usercount> 0)
{
Alert ("a user is using this role and cannot delete it. ");
Args. set_cancel (true );
}
}
}
-->
</SCRIPT>
</Telerik: radcodeblock>