RadChart and Selected Value of ComboBox

Thread is closed for posting
3 posts, 0 answers
  1. fimus
    fimus avatar
    6 posts
    Member since:
    Mar 2009

    Posted 07 Apr 2009 Link to this post

    Hi,
    I tried to display the line chart from database. In order to display several dynamic linechart in the same place, I add a Combobox which is also connected to the database, so user can select the ID to display the linechart interactively. The following code is working to display the line chart based on the default value from combobox. However, when I change the selected value in the combobox, the linechart did not change. Could you help me please, how to make the linechart change based on the selected value from combobox ? Thank you very much in advanced. 
    Example of  MyDB coulmn :   ID , SampleNum, Y1
                                                   1  ,    1 ,              5
                                                   1  ,    2 ,              10
                                                   1  ,    3 ,               4
                                                   2  ,    1,               3
                                                   2  ,    2,               15
                                                   2  ,    3,                6

    Regards.


    <body>

        <form id="form1" runat="server">

        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">

        </telerik:RadScriptManager>

        <div>

       

        </div>

        <telerik:RadComboBox ID="RadComboBox1" Runat="server" DataSourceID="ds1"

            DataTextField="ID" DataValueField="ID">

    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

        </telerik:RadComboBox>

        <asp:AccessDataSource ID="ds1" runat="server" DataFile="~/App_Data/MyDB.mdb"

            SelectCommand="SELECT [ID] FROM [Station]"></asp:AccessDataSource>

        <telerik:RadChart ID="RadChart1" runat="server" DataSourceID="ds2"

            DefaultType="Line" Width="1016px">

        </telerik:RadChart>

        <asp:AccessDataSource ID="ds2" runat="server" DataFile="~/App_Data/MyDB.mdb"

            SelectCommand="SELECT [Y1] FROM [Data] WHERE ([ID] = ?) ORDER BY [SampleNum]">

            <SelectParameters>

                <asp:ControlParameter ControlID="RadComboBox2" DefaultValue="ID" Name="ID"

                    PropertyName="SelectedValue" Type="String" />

            </SelectParameters>

        </asp:AccessDataSource>

        </form>

    </body>

  2. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 08 Apr 2009 Link to this post

    Hello fimus,

    It seems the RadComboBox control misses the AutoPostBack property, so it will not post the page when the value is changed. The chart should be updated when changing the RadCombobox and clicking a button or when setting AutoPostBack to true. This code does not show any other possible issues.

    Best regards,
    Ves
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. fimus
    fimus avatar
    6 posts
    Member since:
    Mar 2009

    Posted 08 Apr 2009 Link to this post

    Hi Ves,
    Thank you very much

    Regards,
    fimus
Back to Top