Domanda

I'm using Telerik's RadChartView control to draw charts in my WinForm application. One of my testers noticed that Telerik charts have some built in functionality where if you right click on the chart you get a context menu that lets you choose from Telerik's list of default color palettes.

This is a problem, because I'm using a custom color palette in my charts, and I've been told to prevent users from adjusting the color palette.

I've spent several hours reading through Telerik's documentation on RadChartView and charts, doing google searches, and adjusting different things in my RadChartView to disable the user's ability to change the color palette. But bottom line, I can't find the answer, I'm stumped.

È stato utile?

Soluzione

I eventually figured out the answer to this question by reading through some old help threads at Telerik's forums. Basically, you need to disable the context menu in the RadChartView altogether, below is the code to do so in VB.net.

Private Sub RemoveContextMenu(ByVal Sender As Object, ByVal e As ChartViewContextMenuOpeningEventArgs) Handles RadChartView.ContextMenuOpening
    e.ContextMenu.Dispose()
End Sub
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top