I have the following Telerik RadListBox, with a template.
<tel:RadListBox ID="ToList" runat="server" DataValueField="Key" EmptyMessage="No Items" style="width:300px;">
<ItemTemplate>
#<asp:Literal runat="server" Text='<%# Eval("AcctNumber") %>' />
<div>
<asp:Literal runat="server" Text='<%# Eval("Amount", "{0:C2}") %>' />
</div>
</ItemTemplate>
</tel:RadListBox>
However, I'd like to insert a blank "- Select -" item at the beginning. I tried adding an item like:
ToList.Items.Insert(0, new RadListBoxItem("- Select -", ""));
However, this adds an item using the given template as the user interface; I'd like it ot use my text. Is this possible to do?
Luckily, there is an easy solution. Put an inline conditional statement in the ItemTemplate, as follows:
http://www.telerik.com/help/aspnet-ajax/combobox-insert-default-item-when-databinding.html