Radpanelbar 折叠/展开问题

发布于 2024-07-29 05:42:12 字数 1073 浏览 15 评论 0原文

伙计们,我对 Telerik 的 RadPanelBar 控件有疑问。 我有 2009 年 Q1 版本的控件。 我有以下 ASP.NET 代码:

<telerik:RadPanelBar Width="297px" ID="RadPanelBar1" runat="server" Skin="Web20" AllowCollapseAllItems="True" ExpandMode="SingleExpandedItem" PersistStateInCookie="True">
    <Items>
            <telerik:RadPanelItem runat="server" Text="Standard Reports" Expanded="True">
                  <ItemTemplate>
                        ... Standard HTML Template code here ...
                  </ItemTemplate>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" Expanded="false" Text="NonStandard Reports">
                   <ItemTemplate>
                             <asp:Label runat="server" Text="test"></asp:Label>
                                </ItemTemplate>
                            </telerik:RadPanelItem>
       </Items>
</telerik:RadPanelBar>

一切正常,但我无法展开或折叠标头。 当我将鼠标悬停在标题上时,我的光标会变成手形,但是当我单击标题时没有任何反应。 有人可以帮我吗?

谢谢

Guys, I am having an issue with Telerik's RadPanelBar control. I have the Q1 2009 version of the controls. I have the follow ASP.NET code:

<telerik:RadPanelBar Width="297px" ID="RadPanelBar1" runat="server" Skin="Web20" AllowCollapseAllItems="True" ExpandMode="SingleExpandedItem" PersistStateInCookie="True">
    <Items>
            <telerik:RadPanelItem runat="server" Text="Standard Reports" Expanded="True">
                  <ItemTemplate>
                        ... Standard HTML Template code here ...
                  </ItemTemplate>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" Expanded="false" Text="NonStandard Reports">
                   <ItemTemplate>
                             <asp:Label runat="server" Text="test"></asp:Label>
                                </ItemTemplate>
                            </telerik:RadPanelItem>
       </Items>
</telerik:RadPanelBar>

Everything works fine, except I cannot expand or collapase the headers. My cursor changes to a hand when I hover over the headers, however nothing happens when I click on the header. Can someone help me out?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

爱人如己 2024-08-05 05:42:12

如果您设置顶级项目的 ItemTemplate - 您将定义项目的内容而不是可折叠区域。 要解决该问题,请定义一个子项并设置其 ItemTemplate 属性:

<telerik:RadPanelBar runat="server">
   <Items>
       <telerik:RadPanelItem Text="Standard Reports">
          <Items>
              <telerik:RadPanelItem>
                 <ItemTemplate>
                     ... Standard HTML Template code here ...
                 </ItemTemplate>
              </telerik:RadPanelItem>
          </Items>
       </telerik:RadPanelItem>
   </Items>
</telerik:RadPanelBar>

我希望这会有所帮助!

If you set the ItemTemplate of top level items - you will define the content of the item not the collapsible area. To solve the problem define a child item and set its ItemTemplate property instead:

<telerik:RadPanelBar runat="server">
   <Items>
       <telerik:RadPanelItem Text="Standard Reports">
          <Items>
              <telerik:RadPanelItem>
                 <ItemTemplate>
                     ... Standard HTML Template code here ...
                 </ItemTemplate>
              </telerik:RadPanelItem>
          </Items>
       </telerik:RadPanelItem>
   </Items>
</telerik:RadPanelBar>

I hope this helps!

笑饮青盏花 2024-08-05 05:42:12

您的页面上有 telerik:RadScriptManager 吗?

Do you have a telerik:RadScriptManager on the page?

若言繁花未落 2024-08-05 05:42:12

您在 ItemTemplate 中添加数据绑定控件时是否尝试过上述方法?
例如,如果您在此处编写了“...标准 HTML 模板代码...”来放置:

<ItemTemplate>
   <asp:Label ID="lblText" runat="server" Text="The index has as ID "></asp:Label>
   <asp:Label ID="lblIndexID" runat="server" Text='<%#Eval("ID") %>'></asp:Label>
</ItemTemplate>

我的 ItemTemplate 始终为空。 我正在绑定到 ICollection。 我不明白为什么这不起作用......

Did you try the above method when adding databound controls in the ItemTemplate?
So for instance where you have written "... Standard HTML Template code here ..." to put:

<ItemTemplate>
   <asp:Label ID="lblText" runat="server" Text="The index has as ID "></asp:Label>
   <asp:Label ID="lblIndexID" runat="server" Text='<%#Eval("ID") %>'></asp:Label>
</ItemTemplate>

My ItemTemplate is always empty. I'm binding to an ICollection. I can't figure out why this isn't working...

葬心 2024-08-05 05:42:12

您可以使用内容模板:

<telerik:RadPanelBar runat="server">
    <Items>
        <telerik:RadPanelItem Text="Standard Reports">
            <ContentTemplate>
                 ... Standard HTML Template code here ...
            </ContentTemplate>
        </telerik:RadPanelItem>
    </Items>
</telerik:RadPanelBar>

You can use ContentTemplate:

<telerik:RadPanelBar runat="server">
    <Items>
        <telerik:RadPanelItem Text="Standard Reports">
            <ContentTemplate>
                 ... Standard HTML Template code here ...
            </ContentTemplate>
        </telerik:RadPanelItem>
    </Items>
</telerik:RadPanelBar>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文