Changlng visiblity on controls within RadPanelBar

2 posts, 0 answers
  1. Tonyz289
    Tonyz289  avatar
    50 posts
    Member since:
    Jun 2011

    Posted 12 Aug 2011 Link to this post

    I am trying to hide/unhide an asp:Panel contained with a RadPanelBar. It works the initial page display (Page.Load)  but when I try to change the visiblity of the asp:Panel once the screen is displayed nothing happens.

    <telerik:RadPanelBar ID="pnlBar" EnableEmbeddedSkins="False" Skin="Panel_AssetDetails"
        runat="server" AllowCollapseAllItems="false" ExpandMode="MultipleExpandedItems"
        Width="516px">
        <Items>
            <telerik:RadPanelItem runat="server" Text="Asset Details" Expanded="true">
                <Items>
                    <telerik:RadPanelItem Value="AssetDetails" runat="server">
                        <ItemTemplate>
                            <table border="0">
                                <tr>
                                    <td>
                                        <b>File Size</b>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblFileSize" runat="server" Text=""></asp:Label>
                                    </td>
                                </tr>
                                <asp:Panel ID="ImagePanel4" runat="server" Visible="true">
                                    <tr>
                                        <td>
                                            <b>Resolution</b>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblResolution" runat="server" Text=""></asp:Label>
                                        </td>
                                    </tr>
                                </asp:Panel>
                                <tr>
                                    <td>
                                        <b>Height</b>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblHeight" runat="server" Text=""></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
        </Items>
    </telerik:RadPanelBar>
    if (asset.assetType == (int)AssetTypes.Image)
    {
        ((Panel)(pnlBar.FindItemByValue ("AssetDetails").FindControl ("ImagePanel4"))).Visible = true;
    }
    else if (asset.assetType == (int)AssetTypes.Document)
    {
        ((Panel)(pnlBar.FindItemByValue ("AssetDetails").FindControl ("ImagePanel4"))).Visible = false;
    }
  2. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 15 Aug 2011 Link to this post

    Hello Tony,

     I am not able to reproduce the problem you experience.

    I am using a regular asp:Button and I handle the click event as follows:

    protected void Button1_Click(object sender, EventArgs e)
    {
        var panel = ((Panel)(pnlBar.FindItemByValue("AssetDetails").FindControl("ImagePanel4")));
        panel.Visible = !panel.Visible;
    }

    Regards,
    Nikolay Tsenkov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

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