RadComboBox - Multicolumn - Insert a Blank Item

2 posts, 0 answers
  1. Calsh
    Calsh avatar
    12 posts
    Member since:
    Dec 2012

    Posted 25 Oct 2013 Link to this post

    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



  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 30 Oct 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top