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

[Solved] Selected ComboBox for Changing the plotted RadChart

2 Answers 115 Views
ComboBox
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 ,              2
                                               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
Princy
Top achievements
Rank 2
answered on 08 Apr 2009, 08:10 AM

Hi Fimus,

I guess the ControlParameter ControlID of AccessDataSource is not set correctly. I found you have given RadComboBox2 for that and the correct ID is RadComboBox1. Try changing these to a common ID and see whether it is working fine for you. See the online demo which illustrates same scenario.
Chart / Database

Thanks,
Princy.

0
fimus
Top achievements
Rank 1
answered on 09 Apr 2009, 12:12 AM
Hi Princy,
Thank you very much

regards,
fimus
Tags
ComboBox
Asked by
fimus
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
fimus
Top achievements
Rank 1
Share this question
or