Embed custom palette in the default ContextMenu

2 posts, 0 answers
  1. Travis
    Travis avatar
    49 posts
    Member since:
    Dec 2012

    Posted 28 May 2013 Link to this post

    Something like chartview-customization-palettes but not quite. I can define a custom palette simple enough. However, how do we embed it in the default Palettes ContextMenu?
  2. Stefan
    Stefan avatar
    2911 posts

    Posted 31 May 2013 Link to this post

    Hi Michael,

    Thank you for writing.

    To do that you need to capture the ContextMenuOpening event of RadChartView, where you can add your custom item:
    radChartView1.ChartElement.ContextMenuOpening += ChartElement_ContextMenuOpening;
    void ChartElement_ContextMenuOpening(object sender, ChartViewContextMenuOpeningEventArgs e)
        RadMenuItem item = new RadMenuItem();
        item.Text = "Custom palette";
        item.Click += item_Click;
    void item_Click(object sender, EventArgs e)
        this.radChartView1.Area.View.Palette = new CustomPalette();
    public class CustomPalette : ChartPalette
        public CustomPalette()
            this.GlobalEntries.Add(Color.Yellow, Color.Red);
            this.GlobalEntries.Add(Color.Yellow, Color.Blue);

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

    RadChart for WinForms is obsolete. Now what?
Back to Top