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

Set ChartType Dynamically

1 Answer 66 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 25 Jun 2008, 09:11 AM
Hi,

I have a Chart.. and a combobox that contains two items viz. 'Bar' and 'Line'. On select of the combobox item, i need to change my chart type. Since ChartType is and Enum... how can i change the ChartType based on the Combobox selected value?
Thanks in Advance
John

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 25 Jun 2008, 03:29 PM
Hello John,

You can use the Enum.Parse(...) method to achieve the desired effect:

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) 
    RadChart1.Series[0].Type = (ChartSeriesType) Enum.Parse(typeof(ChartSeriesType), DropDownList1.SelectedValue); 



Greetings,
Manuel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Chart (Obsolete)
Asked by
John
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or