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

Unable to see expand/collapse icon on panel bar

2 Answers 38 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Aamir Ali Ansari
Top achievements
Rank 2
Aamir Ali Ansari asked on 10 Aug 2010, 12:38 PM
I have used panel bar in one of my web controls. There is another one the main page which is working fine which has items added manually. This one is using template item example. Kindly see to if if I am missing anything. This is to clarify that the the first panel has controls and some functionality which is working fine with code behind. I dont know what is needed to enable these expand collapse button.

<telerik:RadPanelBar ID="RadPanelBar1" Runat="server" Width="95%" 
           Skin="Office2007" AllowCollapseAllItems="True" 
           ExpandMode="SingleExpandedItem">
           <Items>
               <telerik:RadPanelItem runat="server" Text="User Management" 
                   Value="UserManagement">
               <ItemTemplate>
               <asp:Panel ID="pnlUserAdd" runat="server">
         <table style="width:100%;">
           <tr>
               <td class="style9">
                   <asp:Label ID="Label1" runat="server" Text="New User Id"></asp:Label>
               </td>
               <td class="style8">
                   <asp:TextBox ID="TxtUserId" runat="server" Width="150px" MaxLength="10" 
                       ValidationGroup="Entry"></asp:TextBox>
                   <sup>*</sup></td>
               <td>
                   <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                       ErrorMessage="Must Enter User Id" ValidationGroup="Entry" 
                       ControlToValidate="TxtUserId"></asp:RequiredFieldValidator>
               </td>
           </tr>
           <tr>
               <td class="style9">
                   <asp:Label ID="Label2" runat="server" Text="Password"></asp:Label>
               </td>
               <td class="style8">
                   <asp:TextBox ID="txtPassw" runat="server" MaxLength="10" TextMode="Password" 
                       ValidationGroup="Entry" Width="150px"></asp:TextBox>
                   <cc1:PasswordStrength ID="txtPassw_PasswordStrength0" runat="server" 
                       Enabled="True" TargetControlID="txtPassw" 
                       TextCssClass="background-color:white;">
                   </cc1:PasswordStrength>
                   <sup>*</sup></td>
               <td>
                   <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                       ErrorMessage="Must Enter Password" ValidationGroup="Entry" 
                       ControlToValidate="txtPassw"></asp:RequiredFieldValidator>
               </td>
           </tr>
             <tr>
                 <td class="style9">
                     <asp:Label ID="Label24" runat="server" Text="Repeat Password"></asp:Label>
                 </td>
                 <td class="style8">
                     <asp:TextBox ID="txtPassw2" runat="server" TextMode="Password" 
                         ValidationGroup="Entry" Width="150px"></asp:TextBox>
                     <sup>*</sup></td>
                 <td>
                     <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                         ControlToValidate="txtPassw2" ErrorMessage="Must Enter Password" 
                         ValidationGroup="Entry"></asp:RequiredFieldValidator>
                     <asp:CompareValidator ID="CompareValidator1" runat="server" 
                         ControlToCompare="txtPassw" ControlToValidate="txtPassw2" 
                         ErrorMessage="Passwords should be same" ValidationGroup="Entry"></asp:CompareValidator>
                 </td>
             </tr>
           <tr>
               <td class="style16">
                   <asp:Label ID="Label3" runat="server" Text="User Role"></asp:Label>
               </td>
               <td class="style17">
                   <asp:DropDownList ID="drpUserRole" runat="server" ValidationGroup="Entry" 
                       Width="150px">
                   </asp:DropDownList>
                   <sup>*</sup></td>
               <td class="style18">
                   <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Refresh</asp:LinkButton>
                   </td>
           </tr>
             <tr>
                 <td class="style7" colspan="2">
                     <asp:ImageButton ID="imgUserAdd" runat="server" AlternateText="Add User" 
                         Height="45px" ImageUrl="~/Images/user_add.png" ToolTip="Add User" 
                         ValidationGroup="Entry" Width="45px" onclick="imgUserAdd_Click" />
                      </td>
                 <td class="style19">
                     </td>
             </tr>
       </table>
       </asp:Panel>
               </ItemTemplate>
             
               </telerik:RadPanelItem>
               <telerik:RadPanelItem runat="server" Text="Users Data" Value="UsersData">
                  <ItemTemplate>
                  Must Show
                  </ItemTemplate>
               </telerik:RadPanelItem>
               <telerik:RadPanelItem runat="server" Text="Deleted Users">
                  <ItemTemplate>
                  Must Show
                 
                  </ItemTemplate>
               </telerik:RadPanelItem>
               <telerik:RadPanelItem runat="server" Text="User Profile" Value="UserProfile">
               <ItemTemplate>
               Must Show
             
               </ItemTemplate>
               </telerik:RadPanelItem>
           </Items>
       </telerik:RadPanelBar>

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 11 Aug 2010, 02:59 PM
Hi Aamir,

If you use item template then you need to have a child item for your root items. With content template this is not necessary. You can read more about templates in this help topic.

Here is a sample code for reference:
<%--item template--%> 
   <telerik:RadPanelBar ID="RadPanelBar1" runat="server"
       <Items
           <telerik:RadPanelItem runat="server" Text="Root RadPanelItem1"
               <Items
                   <telerik:RadPanelItem runat="server"
                       <ItemTemplate
                           grid 1 
                       </ItemTemplate
                   </telerik:RadPanelItem
               </Items
           </telerik:RadPanelItem
           <telerik:RadPanelItem runat="server" Text="Root RadPanelItem2"
               <Items
                   <telerik:RadPanelItem runat="server"
                       <ItemTemplate
                           grid 2 
                       </ItemTemplate
                   </telerik:RadPanelItem
               </Items
           </telerik:RadPanelItem
       </Items
        
   </telerik:RadPanelBar
  <%-- content template--%> 
   <telerik:RadPanelBar ID="RadPanelBar2" runat="server"
       <Items
           <telerik:RadPanelItem runat="server" Text="Root RadPanelItem1"
               <ContentTemplate
                   grid 1 
               </ContentTemplate
           </telerik:RadPanelItem
           <telerik:RadPanelItem runat="server" Text="Root RadPanelItem2"
               <ContentTemplate
                   grid 2 
               </ContentTemplate
           </telerik:RadPanelItem
       </Items
   </telerik:RadPanelBar>


Regards,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Aamir Ali Ansari
Top achievements
Rank 2
answered on 12 Aug 2010, 08:38 PM
Thanks..Its working now.

Regards
Aamir
Tags
PanelBar
Asked by
Aamir Ali Ansari
Top achievements
Rank 2
Answers by
Peter
Telerik team
Aamir Ali Ansari
Top achievements
Rank 2
Share this question
or