Manuel,
Hi - I loaded your code and I too was successful - however to simulate mine even more closely I added a selected_index change event to the dropdown list. When the event is fired on the server side that is when I load the chart - this broke the code.
Here is the WebUserControl1.ascx code:
<telerik:RadChart ID="RadChart1" runat="server" Height="500px" Width="800px">
</telerik:RadChart>
<
telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy2" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="DropDownList1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="DropDownList1" />
<telerik:AjaxUpdatedControl ControlID="RadChart1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</
telerik:RadAjaxManagerProxy>
<
asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true"
onselectedindexchanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Text="Text1"></asp:ListItem>
<asp:ListItem Text="Text2"></asp:ListItem>
<asp:ListItem Text="Text3"></asp:ListItem>
</
asp:DropDownList>
And here is the code for the WebUserControl1.ascx.cs
protected
void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
LoadChart();
}
private void LoadChart()
{
DataSet SPDataSet = new DataSet();
DataTable tbl = new DataTable();
DataColumn col = new DataColumn("pctChange");
DataColumn col1 = new DataColumn("pctChange2");
col.DataType =
typeof(int);
tbl.Columns.Add(col);
col1.DataType =
typeof(int);
tbl.Columns.Add(col1);
int size = 12;
int maxLen = size.ToString().Length;
for (int i = 1; i <= size; i++)
{
tbl.Rows.Add(
new object[] { i ,i+2});
}
SPDataSet.Tables.Add(tbl);
RadChart1.DataSource = SPDataSet;
ChartSeries series1 = new ChartSeries("PercentChange", ChartSeriesType.Line);
RadChart1.Series.Add(series1);
RadChart1.PlotArea.XAxis.LayoutMode =
ChartAxisLayoutMode.Between;
RadChart1.Series[0].DataYColumn =
"pctChange";
ChartSeries series2 = new ChartSeries("PercentChange2", ChartSeriesType.Line);
RadChart1.Series.Add(series2);
RadChart1.Series[1].DataYColumn =
"pctChange2";
RadChart1.ChartTitle.TextBlock.Text =
"Percent Change By Territory from Q4 '06 to Q4 '07";
RadChart1.AutoLayout =
true;
RadChart1.Legend.Visible =
false;
RadChart1.ClientSettings.EnableZoom =
true;
RadChart1.ClientSettings.ScrollMode = Telerik.Web.UI.
ChartClientScrollMode.XOnly;
RadChart1.ClientSettings.XScale = 4;
// bind to the datasource
RadChart1.DataBind();
}
Thanks for your continued help on this!
joni