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

Changlng visiblity on controls within RadPanelBar

1 Answer 133 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Tonyz289
Top achievements
Rank 1
Tonyz289 asked on 12 Aug 2011, 06:53 PM
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;
}

1 Answer, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 15 Aug 2011, 03:55 PM
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.

Tags
PanelBar
Asked by
Tonyz289
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Share this question
or