We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to remove the Annotation menu item from contextmenu

Thread ID:

Created:

Updated:

Platform:

Replies:

115946 Mar 4,2014 04:30 AM Mar 6,2014 02:13 AM WPF 1
loading
Tags: Chart
bean dou
Asked On March 4, 2014 04:30 AM

Hi,
       I want to remove the Annotation menu item from the contextmenu of ChartArea. Is it possible?  Any help will be appreciated.
 
regards,
bean

Karthikeyan V [Syncfusion]
Replied On March 6, 2014 02:13 AM

Hi Bean,

 

Thank you for using syncfusion products.

 

We have analysed the reported requirement and this can be achieved with the help of the below code snippet.

Code Snippet [C#]:

Chart1.Areas[0].ContextMenu.Opened += ContextMenu_Opened;

      

void ContextMenu_Opened(object sender, RoutedEventArgs e)

{

     ChartAreaContextMenu menu = sender as ChartAreaContextMenu;

     for (int i = 0; i < menu.Items.Count; i++)

     {

         MenuItem item = (MenuItem)menu.Items[i];

         if (item.Header.ToString() == "Add Annotation")

            menu.Items.Remove(item);

     }

}

 

Please let us know if you require further assistance on this.

 

Thanks,

Karthikeyan V.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;