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

Modalpopup called from contextmenu

3 Answers 71 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Yanling
Top achievements
Rank 1
Yanling asked on 08 Oct 2008, 06:34 AM
Hi all,

I use the ajaxcontroltoolkit modalpopupextender to make a ajax popup window without refreshing the page. But when the modalpopup window is called from the options in the contextmenu (no matter it is a contextmenu in treeveiw or radgrid), the page refreshes.

Any ideas?

Thanks.

Hank

3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 13 Oct 2008, 02:15 PM
Hi Yanling,

Have you handled the OnContextMenuItemClick event of the TreeView? If this is so, the Context Menu will postback the page whenever one of its Items is clicked.

You can prevent that by handling the client-side OnContextMenuItemClicking. If you cancel the event the event (if certain conditions are met), the server-side event will not fire.

        function clientContextMenuItemClicking(sender, eventArgs) { 
            eventArgs.set_cancel(true); 
        } 

I hope this helps.

Greetings,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Yanling
Top achievements
Rank 1
answered on 27 Oct 2008, 05:12 AM
Hi Simon,

If I use eventArgs.set_cancel(true), the server code will not run. Then the modal popup will not show.

regards
Hank
0
Simon
Telerik team
answered on 29 Oct 2008, 04:07 PM
Hi Yanling,

In this case, use call the show() client side method of the ModalPopupExtender to show it manually after canceling the OnContextMenuItemClicking event.

Regards,
Simon
the Telerik team

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