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

Context Menu

1 Answer 112 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Rishi
Top achievements
Rank 1
Rishi asked on 05 Sep 2008, 09:27 AM
Hi, I have implemented context menu on tree view to add/rename/copy/delete nodes
every thing is working fine. I have added confirmation message on delete menu item. I mean if user clicks on delete option it will show the confirmation message like "Do you want to delete this node" with OK and CANCEL buttons. It is working fine. But the problem is here when user click on CANCEL button it should not delete the node (there should not be post back). Is there any body who can help me please ?
Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 08 Sep 2008, 11:49 AM
Hello Rishi,

I suggest you subscribe to ClientContextMenuItemClicking event, show the confirmation message in its handler and if the user selects "Cancel" you can cancel the clicking like this:

<script type="text/javascript" language="javascript">  
function ClientContextMenuItemClicking(sender, eventArgs)  
{  
 if(!comfirm('Do you want to delete this node?'))  
  {  
      eventArgs.set_cancel(true);  
  }  
}  
</script>  
 

Greetings,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Rishi
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or