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

RadChart and Selected Value of ComboBox

2 Answers 59 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
fimus
Top achievements
Rank 1
fimus asked on 08 Apr 2009, 04:37 AM
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 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 08 Apr 2009, 06:41 AM
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.
0
fimus
Top achievements
Rank 1
answered on 08 Apr 2009, 11:13 PM
Hi Ves,
Thank you very much

Regards,
fimus
Tags
Chart (Obsolete)
Asked by
fimus
Top achievements
Rank 1
Answers by
Ves
Telerik team
fimus
Top achievements
Rank 1
Share this question
or