radtreeviewcontextmenu with radconfirm dialog

2 posts, 1 answers
  1. orim
    orim avatar
    29 posts
    Member since:
    Mar 2012

    Posted 05 Aug 2013 Link to this post

    i have some problems with radconfirm in contextmenu of a treeview.
    In treeview i want to delete node when click on "Delete" contextemenuitem - I pop up a client side radconfirm dialog.
    radconfirm('Are you sure you want to delete this folder: ' + treeNode.get_text(),
    confirmCallBackFn, 330, 180,
    null, 'Folder-Delete');
    if user click "OK" i need to execute the server side code
    but this event get not hit
    function confirmCallBackFn(arg) {
        //the user clicked OK
        if (arg)
            __doPostBack('<%= RadTreeView1ContextMenu1.Items(3).UniqueId%>', '');
    Help please
  2. Answer
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Aug 2013 Link to this post

    Hi orim,

    Please have a look into the following code I tried which works fine at my end.

    <telerik:RadTreeView ID="RadTreeView1" runat="server" OnClientContextMenuItemClicking="OnClientContextMenuItemClicking"

    <script type="text/javascript">
        var clickCalledAfterRadconfirm = false;
        var menuItem;
        function OnClientContextMenuItemClicking(sender, args) {
            if (!clickCalledAfterRadconfirm) {
                menuItem = args.get_menuItem();
                radconfirm("Are you sure you want to Delete?", confirmCallbackFunction);
        function confirmCallbackFunction(args) {
            if (args) {
                clickCalledAfterRadconfirm = true;
            else {
                clickCalledAfterRadconfirm = false;
            menuItem = null;

    protected void RadTreeView1_ContextMenuItemClick(object sender, Telerik.Web.UI.RadTreeViewContextMenuEventArgs e)
        //your  code to delete

Back to Top