Click here to Skip to main content
15,888,073 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Everyone i am trying to use submenu to dropdown list by using list or option but it doesn't allow to use list or option can any one help, As i want to add submenu in support option




<asp:DropDownList ID="ddlPhase" CssClass="selectbox1" runat="server">
                            <asp:ListItem Value="-1">-SELECT-</asp:ListItem>
                            <asp:ListItem Text="Analysis" Value="Analysis"></asp:ListItem>
                             <asp:ListItem Text="Planning" Value="Planning"></asp:ListItem>
                              <asp:ListItem Text="Execution" Value="Execution"></asp:ListItem>
                               <asp:ListItem Text="Control" Value="Control"></asp:ListItem>
                            <asp:ListItem Text="Support" Value="Support"></asp:ListItem>
                            </asp:DropDownList>


What I have tried:

<asp:DropDownList ID="ddlPhase" CssClass="selectbox1" runat="server">
                            <asp:ListItem Value="-1">-SELECT-</asp:ListItem>
                            <asp:ListItem Text="Analysis" Value="Analysis"></asp:ListItem>
                             <asp:ListItem Text="Planning" Value="Planning"></asp:ListItem>
                              <asp:ListItem Text="Execution" Value="Execution"></asp:ListItem>
                               <asp:ListItem Text="Control" Value="Control"></asp:ListItem>
                            <asp:ListItem Text="Support" Value="Support">
<li>****</Li></asp:ListItem>
                            </asp:DropDownList>


I tried google also please can anyone help
Posted
Updated 24-Sep-17 22:35pm
v2

1 solution

try something like this

<asp:DropDownList ID="ddlPhase"  runat="server">
      <asp:listitem value="-1">-SELECT-</asp:listitem>
      <asp:listitem text="Analysis" value="Analysis"></asp:listitem>
      <asp:listitem text="Planning" value="Planning"></asp:listitem>
      <asp:listitem text="Execution" value="Execution"></asp:listitem>
      <asp:listitem text="Control" value="Control"></asp:listitem>
      <asp:listitem style="font-weight:bold" text="Support" value="Support"></asp:listitem>
      <asp:listitem text="   Support 1" value="Support1"></asp:listitem>
      <asp:listitem text="   Support 2" value="Support2"></asp:listitem>
      <asp:listitem  style="font-weight:bold" text="Other" value="Other"></asp:listitem>
      <asp:listitem text="   Other 1" value="Other1"></asp:listitem>
      <asp:listitem text="   Other 2" value="Other2"></asp:listitem>
  </asp:DropDownList>

or have a look on HTML optgroup tag[^]

use & nbsp;[^] for space
 
Share this answer
 
v3
Comments
Member 11644373 25-Sep-17 4:46am    
But i want support 1 and support 2 to be open on click of select as sub menu as per you it will show one after another
Karthik_Mahalingam 25-Sep-17 4:56am    
show some example on how you expect.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900