DropDown in AjaxPanel?

3 posts, 0 answers
  1. John
    John avatar
    41 posts
    Member since:
    Jun 2008

    Posted 19 Nov 2015 Link to this post


    I have an AjaxPanel with a dropdown list, chart, and textbox and am trying to get the value of the dropdown list from OnSelectedIndexChanged, but for some reason it is not working, I always get 0 in the textbox, and when I put a break point in the method it is never reached.

       <div class="demo-container size-wide">
            <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" Height="600px" Width="800px">
              <asp:Label ID="Label1" runat="server" Text="Start Date: "></asp:Label><asp:DropDownList ID="drpStartDate" runat="server" AutoPostBack="true" ></asp:DropDownList>
              <asp:Label ID="Label2" runat="server" Text="End Date: "></asp:Label><asp:DropDownList ID="drpEndDate" runat="server" AutoPostBack="true" ></asp:DropDownList>
              <asp:Label ID="Label3" runat="server" Text="Select Chart: "></asp:Label><asp:DropDownList ID="drpChart" runat="server" AutoPostBack="true" OnSelectedIndexChanged="drpChart_SelectedIndexChanged" ></asp:DropDownList>

              <telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" Width="800px" Height="500px">
                   <XAxis AxisCrossingValue="0" Color="black" MajorTickType="Outside" MinorTickType="Outside" Reversed="false" DataLabelsField="Date">
                        <LabelsAppearance DataFormatString="{0}" RotationAngle="0" Skip="0" Step="1">
                        <TitleAppearance Position="Center" RotationAngle="0" Text="Days">
                <telerik:LineSeries Name="Net Collections" DataFieldY="NetCollections">
                    <LabelsAppearance DataFormatString="${0}" Position="Above" />
                    <MarkersAppearance MarkersType="Circle" />
                   <telerik:LineSeries Name="Net Production" DataFieldY="NetProduction">
                    <LabelsAppearance DataFormatString="${0}" Position="Above" />
                    <MarkersAppearance MarkersType="Circle" />
            <Appearance Visible="false" />
        <ChartTitle Text="Net Production vs Net Collections">


                    <asp:TextBox ID="txtDebug" runat="server" Height="177px" TextMode="MultiLine" Width="547px"></asp:TextBox>



    string[] sCharts = new string[] { "Select Chart...",
                                          "Net Production vs Net Collections",
                                          "Collection Ratio",
                                          "Hygiene Ratio",
                                          "Production Adjustment Ratio",
                                          "New Patients",
                                          "Accounts Receivable vs Collections"};

            drpChart.DataSource = sCharts;

        protected void drpChart_SelectedIndexChanged(object sender, EventArgs e)
          txtDebug.Text += drpChart.SelectedIndex.ToString();
          txtDebug.Text += drpChart.SelectedItem.ToString();
          txtDebug.Text += drpChart.SelectedValue;

  2. John
    John avatar
    41 posts
    Member since:
    Jun 2008

    Posted 19 Nov 2015 in reply to John Link to this post

    When I run the page and make a selection from the DropDown, the page refreshes and automatically sets the dropdown back to "Select Chart..." Not sure if that is because of the AjaxPanel, the autopostback, or?
  3. Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 23 Nov 2015 Link to this post

    Hello John,

    Please revise the answer provided in the other thread you have opened for the same issue and see if it helps.

    Maria Ilieva
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top