This question is locked. New answers and comments are not allowed.
I am not able to access the collection items of the ChartLegend controller. In fact, I can see it enumerated in debugging mode but whenever I try to access those items individually, it throws me "system.typeloadexception".
Here are the control names and properties I am talking about -
I have following event
Here is some more information about what's happening. I see 4 items listed within my CharLegend controller but Count property shows - "System.TypeLoadException" -
- directcast(sender,ChartLegend).ItemsSource Count = {System.TypeLoadException} System.Collections.IEnumerable
+ (0) {Telerik.Windows.Controls.Charting.ChartLegendItem} Telerik.Windows.Controls.Charting.ChartLegendItem
+ (1) {Telerik.Windows.Controls.Charting.ChartLegendItem} Telerik.Windows.Controls.Charting.ChartLegendItem
+ (2) {Telerik.Windows.Controls.Charting.ChartLegendItem} Telerik.Windows.Controls.Charting.ChartLegendItem
+ (3) {Telerik.Windows.Controls.Charting.ChartLegendItem} Telerik.Windows.Controls.Charting.ChartLegendItem
so I tried to enumerate through the collection using GetEnumerator method and then when I used current property it threw me back InvalidOperation exception.
I want to do something like this on my event handler -
Here are the control names and properties I am talking about -
Public Property Items() As Telerik.Windows.Controls.Charting.ChartLegendItemCollectionMember of Telerik.Windows.Controls.Charting.ChartLegendI have following event
Public Event DataBound(ByVal sender As Object, ByVal e As Telerik.Windows.Controls.Charting.ChartDataBoundEventArgs) (Member of Telerik.Windows.Controls.RadChart)Here is some more information about what's happening. I see 4 items listed within my CharLegend controller but Count property shows - "System.TypeLoadException" -
- directcast(sender,ChartLegend).ItemsSource Count = {System.TypeLoadException} System.Collections.IEnumerable
+ (0) {Telerik.Windows.Controls.Charting.ChartLegendItem} Telerik.Windows.Controls.Charting.ChartLegendItem
+ (1) {Telerik.Windows.Controls.Charting.ChartLegendItem} Telerik.Windows.Controls.Charting.ChartLegendItem
+ (2) {Telerik.Windows.Controls.Charting.ChartLegendItem} Telerik.Windows.Controls.Charting.ChartLegendItem
+ (3) {Telerik.Windows.Controls.Charting.ChartLegendItem} Telerik.Windows.Controls.Charting.ChartLegendItem
so I tried to enumerate through the collection using GetEnumerator method and then when I used current property it threw me back InvalidOperation exception.
I want to do something like this on my event handler -
Dim graph As RadChart = DirectCast(sender, RadChart) Dim abc As ChartLegendItemCollection = graph.DefaultView.ChartLegend.Items() Dim newabc As New ChartLegendItemCollection For i As Integer = 0 To abc.count - 1 newabc.Add(abc(0)) abc.RemoveAt(0)Next abc = New ChartLegendItemCollection(newabc) 'then something to rebind the control back or refresh the silverlight control\