Open Panel in Edit Form Template

3 posts, 1 answers
  1. Jack
    Jack avatar
    131 posts
    Member since:
    May 2003

    Posted 11 Jun 2014 Link to this post

    Hi Guys,

    In my edit form template, I need to open a panel that holds a RadEditor on the conditional selection from a RadComboBox that is also in the edit form template.
    So for example, if the user selects'add extra details' a panel will open with an editor.

    Cheers in advance,


  2. Answer
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Jun 2014 in reply to Jack Link to this post

    Hi Jack,

    Please take a look at the sample code snippet to achieve your requirement.

    <EditFormSettings EditFormType="Template">
            <telerik:RadComboBox ID="rcbSelect" runat="server" EmptyMessage="Select" AutoPostBack="true" OnSelectedIndexChanged="rcbSelect_SelectedIndexChanged">
                    <telerik:RadComboBoxItem Text="1" Value="1" />
                    <telerik:RadComboBoxItem Text="2" Value="2" />
            <asp:Panel ID="pnlEditor" runat="server" Visible="false">
                <telerik:RadEditor ID="rEditor" runat="server">

    protected void rcbSelect_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
      RadComboBox rcbselect = (RadComboBox)sender;
      GridEditableItem editItem = (GridEditableItem)rcbselect.NamingContainer;
      //Access the panel in EditForm
      Panel pnlEditor = (Panel)editItem.FindControl("pnlEditor");
      if (rcbselect.SelectedValue == "1")
        pnlEditor.Visible = true;
        pnlEditor.Visible = false;

  3. Jack
    Jack avatar
    131 posts
    Member since:
    May 2003

    Posted 13 Jun 2014 in reply to Shinu Link to this post

    Many thanks Shinu,

    I've been here before on this one but got stuck on insert.
    You code does indeed work and for anyone else reading - this worked for me:-

    I tried using Visible='<%#Bind("reqQon") %>' for the panel, which works as expected in edit mode. But in Insert Mode - it could not bind the default value.

    In another thread you were helping in, I found this from J.Hoventer

    Visible='<%# GetDefaultBool(Eval("reqQon")) %>'
    Protected Function GetDefaultBool(ByVal input As Object) As Boolean
            If input Is Nothing OrElse input.ToString() = "" OrElse input.ToString().ToLower() = "false" Then
                Return False
                Return True
            End If
        End Function

    All good now!

Back to Top