I have a RadComboBox setup to display Checkboxes, like this:
<telerik:RadComboBox ID="cmbLocation" Name="Location" runat="server" DataTextField="Key" DataValueField="Value" TabIndex="18" Width="214"
OnClientDropDownClosing="OnClientDropDownClosing" MarkFirstMatch="true" AllowCustomText="false">
<asp:CheckBox runat="server" ID="chkLocation" Text='<%# Eval("Key")%>'/>
The ComboBox is then simply bound to a List<KeyValuePair<string,int>> datasource in code behind.
I need to add an item to the top of the list that simply says "ALL". I really don't need a Checkbox in this item, for what it is worth.
I am currently doing this:
cmbLocation.Items.Insert(0, new RadComboBoxItem(Common.All, "-1"));
This works more or less. When I run the app, the ComboBox reads "All". But there is also a blank checkbox in the first position. I don't want that to be there. But I do need to be able to tell if All is selected.
WHen I look in the generated HTML code, I see that the first item is only an <input> (type of checkbox). All the rest of the items have both a <label> and an <input>.
What's the right way to add a default item here?