RadListBox Delete with RadConfirm

3 posts, 0 answers
  1. Anatoliy
    Anatoliy avatar
    37 posts
    Member since:
    Oct 2012

    Posted 08 Nov 2012 Link to this post

    Hello Telerik team,

    I have Delete logic on server side & want to use radconfirm. Prompt me how I can turn from java script method RadListBox1Deleted!

    function RadListBox1Deleting(sender, arg) {
                 var callBackFunction = Function.createDelegate(sender, function (shouldSubmit) {
                     if (shouldSubmit) {
                         // call server side RadListBox1Deleted
                     }
                 });
                 var text = "Are you sure you want to delete?";
                 radconfirm(text, callBackFunction, 300, 100, null, "Deleting");
                 arg.set_cancel(true);
             }

  2. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 13 Nov 2012 Link to this post

    Hi Anatoliy,

    Please consider the following implementation, in order to call the server side event Deleted:
    <script type="text/javascript">
           function RadListBox1Deleting(sender, arg) {
               var callBackFunction = Function.createDelegate(sender, function (shouldSubmit) {
                   if (shouldSubmit) {
                       sender.postback({ type: Telerik.Web.UI.ListBoxCommand.Delete });
                   }
               });
               var text = "Are you sure you want to delete?";
               radconfirm(text, callBackFunction, 300, 100, null, "Deleting");
               arg.set_cancel(true);
           }
       </script>



    Greetings,
    Nencho
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Anatoliy
    Anatoliy avatar
    37 posts
    Member since:
    Oct 2012

    Posted 15 Nov 2012 Link to this post

    Hi Nencho, Thanks a lot!
Back to Top