|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DropDownList <optgroup>DropDownLists? Theoretical code that should work: <asp:DropDownList id="ddlWeightClass" runat="server"> <optgroup label="Light Weight"> <asp:ListItem Value="50">50</asp:ListItem> <asp:ListItem Value="51">51</asp:ListItem> <asp:ListItem Value="52">52</asp:ListItem> <asp:ListItem Value="53">53</asp:ListItem> </optgroup> <optgroup label="Middle Weight"> <asp:ListItem Value="120">120</asp:ListItem> <asp:ListItem Value="121">121</asp:ListItem> <asp:ListItem Value="122">122</asp:ListItem> </optgroup> </asp:DropDownList> Which I wish would render as: <select name="ddlWeightClass" id="ddlWeightClass"> <optgroup label="Light Weight"> <option value="50">50</option> <option value="51">51</option> <option value="52">52</option> </optgroup> <optgroup label="Middle Weight"> <option value="120">120</option> <option value="121">121</option> <option value="122">122</option> </optgroup> </select> here is a link to a similar example http://www.webdevtips.com/webdevtips/html/accessibility/form_tags.shtml Thank you, Art Clark You're probably going to have to create your own control. You'll have
to have a collection of optgroups, with each one having a collection of listitems. It's like a table, which has a collection of rows, each of which has a collection of cells. I'm looking into writing a table control that will allow me to have tbody, thead and tfoot tags, and it's the same sort of pain in the rear. Sorry, Lisa u***@sympatico.ca wrote: Show quoteHide quote > Just wondering if anyone has figured out a way to add <optgroup> to > DropDownLists? > Theoretical code that should work: > > <asp:DropDownList id="ddlWeightClass" runat="server"> > <optgroup label="Light Weight"> > <asp:ListItem Value="50">50</asp:ListItem> > <asp:ListItem Value="51">51</asp:ListItem> > <asp:ListItem Value="52">52</asp:ListItem> > <asp:ListItem Value="53">53</asp:ListItem> > </optgroup> > <optgroup label="Middle Weight"> > <asp:ListItem Value="120">120</asp:ListItem> > <asp:ListItem Value="121">121</asp:ListItem> > <asp:ListItem Value="122">122</asp:ListItem> > </optgroup> > </asp:DropDownList> > > Which I wish would render as: > > <select name="ddlWeightClass" id="ddlWeightClass"> > <optgroup label="Light Weight"> > <option value="50">50</option> > <option value="51">51</option> > <option value="52">52</option> > </optgroup> > <optgroup label="Middle Weight"> > <option value="120">120</option> > <option value="121">121</option> > <option value="122">122</option> > </optgroup> > </select> > > here is a link to a similar example > http://www.webdevtips.com/webdevtips/html/accessibility/form_tags.shtml > > Thank you, > Art Clark
Custom control: How to render an embedded image at design-time?
Render and Image on a Button Web User Controls: Exposing Items property of contained controls Load User Control from different directory Tool to monitor/trace all method calls? WinForm as ASP.NET custom control Webcontrol Designer Awareness... Re: accessibility and asp:button Register directive for custom web control in VS 2005 Beta 2 accessing a specific cotrol from web DataGrid control. |
|||||||||||||||||||||||