Is it possible to include optgroup-like items in a WebDropDown control? For example:
<optgroup label="Operating System">
<option value="Mac">Mac</option>
<option value="PC">PC</option>
</optgroup>
Hi,
Currently this is not possible out of the box, but using the <Templates> collection, this is easily achievable.
For the items that you would like to be of type <optgroup>, define the following template:
<ig:Template ID="optgroupTemplate">
<optgroup label="<%# DataBinder.Eval(Container.DataItem, "<label property>")%>">
</ig:Template>
Then for the other items define:
<Template ID="optionTemplate">
<option value="<%# DataBinder.Eval(Container.DataItem, "<value property>")%>">
</Template>
Then in code behind (or in markup) you can associate the actual DropDown items with the templates, so you get the correct rendering and structure.
Please let me know if you need a more detailed example (you can also contact our Development Support team for this).
Thank you,
Angel
Sorry for the late reply, but this request got temporarily shelved. It looks as if it has reared its head again. Could you provide a more detailed example ASAP?