This is a migrated thread and some comments may be shown as answers.

Selection of bar on combo selectin change

1 Answer 21 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Ramya
Top achievements
Rank 1
Ramya asked on 28 Apr 2011, 01:33 PM
Hi,

    i have all the x axis values on a graph within the combo. suppose i select a value in the combox tht corresponding bar should be selected in the chart suppose i have mango,apple in the x-axis and the same name appears in my combo box too.so when i select mango on the combo box the corresponding bar realted to mango shld be selected.is der a possibility any help?

regards
Muneer


1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 03 May 2011, 02:08 PM
Hello Ramya,

First you need to define the InteractivitySettings of the SeriesDefinition:
<telerik:BarSeriesDefinition>
    <telerik:BarSeriesDefinition.InteractivitySettings>
        <telerik:InteractivitySettings HoverScope="None" SelectionScope="Item" />
    </telerik:BarSeriesDefinition.InteractivitySettings>
</telerik:BarSeriesDefinition>

After that you can set the RadChart.DefaultView.ChartArea.SelectItem(int itemIndex) in the ComboBox.SelectionChanged event. In this case the itemIndex will be the ComboBox.SelectedIndex.
private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    RadChart.DefaultView.ChartArea.SelectItem(((ComboBox)sender).SelectedIndex);
}

Please note that you need to sort the Items of the ComboBox, so that their order will be like the order of the items on the XAxis. This will ensure that when you select an item from the ComboBox its index will be the same as the needed item in the RadChart.

I hope this helps

Greetings,
Polina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Ramya
Top achievements
Rank 1
Answers by
Missing User
Share this question
or