Hello,
I am trying to create a ListView that contains a custom visual item containing multiple ChartViews. What I am trying to achieve is a list, with some text for each item on the left and multiple pie charts horizontally across the item. I have looked at the documentation for creating custom items in a ListView and taken basically the same approach. I create a StackLayoutPanel in CreateChildItems in my SimpleListViewVisualItem derived class. I add a LightVisualElement to the layout which will contain some text. Then I try to add RadChartElements to the stack. The problem is I cannot figure out the correct way to create the RadChartElement for this scenario. I have tried many variations, but none seem to work.
I have tried to declare RadChartView's as members in the VisualItem class, create them in them in CreateChildItems and add them with a call like layout.Children.Add(myChartView.ChartElement). Then in SynchronizeProperties, I go ahead and blow away the series for the chart and recreate it with the correct data for the item. This almost works, except that only the first item in my list will ever display correctly.
I have tried to declare RadChartElement's as members of the VisualItem class, but then I cannot figure out how to set the series for the chart in SynchronizeProperties
I have even tried creating the RadChartView in CreateChildItems, then in SynchronizeProperties, I just recreate the RadChartView and point the children of the layout to the newly created chart.ChartElement.
I have tried just recreating the entire layout in SynchronizeProperties.
...and many more combinations.
The best I could do with any of my attempts did correctly display the *first item*, with text on the left and four pie charts with correct data to the right, but *only the first item*. In all the other items, the chart elements appear blank.
Is this impossible in the current version of the controls for Winforms, or am I missing something?
Best regards,
Justin
I am trying to create a ListView that contains a custom visual item containing multiple ChartViews. What I am trying to achieve is a list, with some text for each item on the left and multiple pie charts horizontally across the item. I have looked at the documentation for creating custom items in a ListView and taken basically the same approach. I create a StackLayoutPanel in CreateChildItems in my SimpleListViewVisualItem derived class. I add a LightVisualElement to the layout which will contain some text. Then I try to add RadChartElements to the stack. The problem is I cannot figure out the correct way to create the RadChartElement for this scenario. I have tried many variations, but none seem to work.
I have tried to declare RadChartView's as members in the VisualItem class, create them in them in CreateChildItems and add them with a call like layout.Children.Add(myChartView.ChartElement). Then in SynchronizeProperties, I go ahead and blow away the series for the chart and recreate it with the correct data for the item. This almost works, except that only the first item in my list will ever display correctly.
I have tried to declare RadChartElement's as members of the VisualItem class, but then I cannot figure out how to set the series for the chart in SynchronizeProperties
I have even tried creating the RadChartView in CreateChildItems, then in SynchronizeProperties, I just recreate the RadChartView and point the children of the layout to the newly created chart.ChartElement.
I have tried just recreating the entire layout in SynchronizeProperties.
...and many more combinations.
The best I could do with any of my attempts did correctly display the *first item*, with text on the left and four pie charts with correct data to the right, but *only the first item*. In all the other items, the chart elements appear blank.
Is this impossible in the current version of the controls for Winforms, or am I missing something?
Best regards,
Justin