RadComboBox Filtering on item.value as well as item.text

4 posts, 2 answers
  1. Adam
    Adam avatar
    7 posts
    Member since:
    Sep 2013

    Posted 23 Jan 2014 Link to this post

    Hi all, real quick question here, is it at all possible some how to allow the filter / markfirstmatched stuff to filter the list on the item.value as well as the text but only display the text element..?

    Basically, we have a list of establishments and the value for each establishment is it's site id, some people would love to just type in the 4 digit site id instead of the full name of the site (old school people who are fast with the number pad...) and so it'd be really good if I could specifiy what the items get filtered on?

    If I can't filter on both the text and value, could I atleast change to filtering to point at the item.tooltip as I have added both the Text and Value into the tooltip...

    Thanks in advance!!!

    Adam.
  2. Answer
    Jon
    Jon avatar
    7 posts
    Member since:
    Mar 2013

    Posted 23 Jan 2014 Link to this post

    You could make the combo box multi-column (via a template) putting the id in one column and the name in the other.  Then mark first match should work for you.  We do this with Client Name and Client ID.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Jan 2014 Link to this post

    Hi Adam,

    Please have a look into the sample code snippet as suggested by Jon.

    ASPX:
    <telerik:RadComboBox runat="server" ID="RadComboBox2" Height="190px" Width="420px"
        EmptyMessage="Select" DataTextField="Cityname" DataValueField="Countryname" DataSourceID="SqlDataSource1"
        AutoPostBack="true" AllowCustomText="true" Filter="StartsWith">
        <HeaderTemplate>
            <ul>
                <li class="col1">City Name</li>
                <li class="col2">Country Name</li>
            </ul>
        </HeaderTemplate>
        <ItemTemplate>
            <ul>
                <li class="col1">
                    <%# DataBinder.Eval(Container.DataItem, "Cityname")%></li>
                <li class="col2">
                    <%# DataBinder.Eval(Container.DataItem, "Countryname")%></li>
            </ul>
        </ItemTemplate>
    </telerik:RadComboBox>

    Thanks,
    Shinu.
  5. Adam
    Adam avatar
    7 posts
    Member since:
    Sep 2013

    Posted 28 Jan 2014 in reply to Jon Link to this post

    Spot on! :) I set the display of the ID column to none also so it still looks the same, but has the hidden additional data :)

    Thanks so much! :)
Back to Top