RadDropDownList OnItemSelected is clearing the RadSplitter

2 posts, 0 answers
  1. Erick
    Erick avatar
    8 posts
    Member since:
    May 2015

    Posted 25 Jun 2015 Link to this post

    I have a RadSplitter with two Pane and one SplitBar. On one Pane I have a dropdownlist, which when selected should change a textbox visibility to true. However it is completely clearing both RadPanes and not displaying anything.

     

    Here is the code:

    <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1">
                    <telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%" Height="100%">
                        <telerik:RadPane ID="LeftPane" runat="server" Width="75%">
                            <h3>Orders</h3>
                        </telerik:RadPane>
                        <telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Backward">
                        </telerik:RadSplitBar>
                        <telerik:RadPane ID="RightPane" runat="server" Width="25%">
                            <div style="padding-left:10px; padding-right:10px;padding-top:5px;">
                                <h4>Filters</h4>
                                <hr style="width:100%;" />
                                <table>
                                    <tr>
                                        <td><asp:Label ID="lblCustomer" runat="server" Text="Customer #"></asp:Label></td>
                                        <td><telerik:RadDropDownList ID="ddlCustomer" runat="server" AutoPostBack="true" DefaultMessage="Select One.." OnItemSelected="ddlCustomer_ItemSelected"></telerik:RadDropDownList></td>
                                        <td><telerik:RadTextBox ID="txtCust" runat="server" AutoPostBack="true" Visible="false"></telerik:RadTextBox></td>
                                    </tr>
                                </table>
                            </div>
                         
                        </telerik:RadPane>
                    </telerik:RadSplitter>
                </telerik:RadAjaxPanel>

     

     

     

    protected void Page_Load(object sender, EventArgs e)
            {
                if (!Page.IsPostBack)
                {
                    ddlCustomer.DataSource = new List<string>() { "Cust1", "Cust2" };
                    ddlCustomer.DataBind();
                }
            }
     
            protected void ddlCustomer_ItemSelected(object sender, Telerik.Web.UI.DropDownListEventArgs e)
            {
                if (ddlCustomer.SelectedItem != null)
                    txtCust.Visible = true;
            }

     

    Am I missing something?

  2. Erick
    Erick avatar
    8 posts
    Member since:
    May 2015

    Posted 26 Jun 2015 in reply to Erick Link to this post

    Figured it out. Instead of using <telerik:RadAjaxPanel...> you need to wrap it in <asp:UpdatePanel...

     

    Example:

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <telerik:RadSplitter ID="RadSplitter1" runat="server">
                     //Do stuff
            </telerik:RadSplitter>
        </ContentTemplate>
    </asp:UpdatePanel>

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top