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

RadDropDownList OnItemSelected is clearing the RadSplitter

1 Answer 64 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Erick
Top achievements
Rank 1
Erick asked on 25 Jun 2015, 09:09 PM

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?

1 Answer, 1 is accepted

Sort by
0
Erick
Top achievements
Rank 1
answered on 26 Jun 2015, 07:41 PM

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>

Tags
Splitter
Asked by
Erick
Top achievements
Rank 1
Answers by
Erick
Top achievements
Rank 1
Share this question
or