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

RadHTMLChart Dynamic DataSource?

1 Answer 124 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 21 Sep 2012, 02:07 AM
Hi,

I have a radhtml column chart that i want to change the datasource of based on the selected values of 2 dropdown lists.  i am using a radscriptmanager and have the dropdown lists listed as update controls (see code below), however when the page posts back, it loads nothing in the chart area...no x or y axis or anything. 

is it possible to update the data source of a radHTML chart dynamically?

HTML: 
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePartialRendering="true" ScriptMode="Release">

    </telerik:RadScriptManager>



<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

    <AjaxSettings>

       <telerik:AjaxSetting AjaxControlID="ddlAssetType" EventName="SelectedIndexChanged" >

        <telerik:AjaxSetting AjaxControlID="ddlChart" >

            <UpdatedControls>

                <telerik:AjaxUpdatedControl ControlID="rcStats" />

            </UpdatedControls>

        </telerik:AjaxSetting>

        <telerik:AjaxSetting AjaxControlID="ddlRange" >

            <UpdatedControls>

                <telerik:AjaxUpdatedControl ControlID="rcStats" />

            </UpdatedControls>

        </telerik:AjaxSetting>

    </AjaxSettings>

</telerik:RadAjaxManager>


and this is what i am calling on the backend:

 rcStats.DataSource = list

        rcStats.DataBind()



any help would be greatly appreciated!

Thanks,

Ryan

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 24 Sep 2012, 08:54 AM
Hi Ryan,

Your RadAjaxManager declaration is not correct, you have extra AjaxSetting opening tag. Your settings should look like this:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="ddlAssetType" EventName="SelectedIndexChanged">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rcStats" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="ddlRange">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rcStats" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>



Greetings,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Chart (HTML5)
Asked by
Ryan
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or