RadHTMLChart Dynamic DataSource?

2 posts, 0 answers
  1. Ryan
    Ryan avatar
    1 posts
    Member since:
    Sep 2012

    Posted 20 Sep 2012 Link to this post

    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

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 24 Sep 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top