This is a migrated thread and some comments may be shown as answers.

RadComboBox - Multicolumn - Insert a Blank Item

1 Answer 370 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Calsh
Top achievements
Rank 1
Calsh asked on 25 Oct 2013, 09:31 AM
Hi

Using a Multicolumn Combobox with OpenAccess and trying to insert a blank item - as need to have the option of not selecting any item from the list - tried various solutions/posts with no success - code for combobox as below

<telerik:RadComboBox runat="server" ID="RadComboBox1" Height="190px" Width="100%"
    MarkFirstMatch="true" DataSourceID="OpenAccessLinqDataSource1" EnableLoadOnDemand="true"
    HighlightTemplatedItems="true" DataValueField="PartID" DataTextField="PartNumber"
    AppendDataBoundItems="True" SelectedValue='<%# Bind("PartID") %>' ItemsPerRequest="10"
    EnableVirtualScrolling="True" Filter="Contains" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged"
    AutoPostBack="True">
    <HeaderTemplate>
        <ul>
            <li class="col1">Part Number</li>
            <li class="col2">Part Description</li>
        </ul>
    </HeaderTemplate>
    <ItemTemplate>
        <ul>
            <li class="col1">
                <%# DataBinder.Eval(Container.DataItem, "PartNumber")%>
            </li>
            <li class="col2">
                <%# DataBinder.Eval(Container.DataItem, "PartDescription")%></li>
        </ul>
    </ItemTemplate>
</telerik:RadComboBox>

Tried online demo http://www.telerik.com/help/aspnet-ajax/combobox-insert-default-item-when-databinding.html 

(Using vb)

Thanks



1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 30 Oct 2013, 09:38 AM
Hello,

In this case I would suggest using the RadComboBox default item. Here you may find more information and some sample code.


Regards,
Boyan Dimitrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
ComboBox
Asked by
Calsh
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or