Multi column RadCombobox & Filter 'contains'

4 posts, 1 answers
  1. Kristof
    Kristof avatar
    1 posts
    Member since:
    Oct 2008

    Posted 02 Oct 2008 Link to this post

    My situation
    I have a RadGrid where some columns contain RadComboBoxes.  These RadComboBoxes only display a code (mostly 3 characters), when they open they display two columns (the code and a description).

    My RadComboBox is defined as follows:

    <telerik:RadComboBox Width="65px" DropDownWidth="270" ID="radComboBoxVHT"   
       Filter="contains" AllowCustomText="true" HighlightTemplatedItems="true"   
       markfirstmatch="true" runat="server" EnableLoadOnDemand="true"   
       EnableScreenBoundaryDetection="true" DataSourceID="dataSourceVHT" DataTextField="Code"   
       DataValueField="Code" SelectedValue='<%#Bind("VHTCode") %>' > 
            <HeaderTemplate> 
                <table style="width:250px;" cellspacing="0" cellpadding="0">
                 <tr> 
                        <td style="width:50px;">Code</td> 
                        <td style="width:200px;">Description</td> 
                     </tr>
                 </table>  
            </HeaderTemplate> 
            <ItemTemplate> 
                <table style="width:250px;" class="comboTable" cellspacing="0" cellpadding="0">  
                    <tr> 
                        <td style="width:50px;">  
                            <div class='comboItem'>  
                                <%#DataBinder.Eval(Container.DataItem, "Code")%> 
                            </div> 
                        </td> 
                        <td style="width:200px;">  
                            <div class='comboItem'>  
                                <%#DataBinder.Eval(Container.DataItem, "Description")%> 
                            </div> 
                        </td> 
                    </tr> 
                </table> 
            </ItemTemplate> 
    </telerik:RadComboBox> 

    The problem
    When the user starts typing in the combobox, it's only filtering on the first column (Code).  I also wants it to filter on the second column.  In fact: on both columns.

    Example I have following two items in the combobox:

    REQ | Send a request
    FIN | Require finishing

    When the user starts typing "req" I still want to see both items, and not only the first.

  2. Answer
    Yana
    Admin
    Yana avatar
    5013 posts

    Posted 02 Oct 2008 Link to this post

    Hello Kristof,

    Please check the attached sample project which demonstrates the needed approach. Download it and give it a try.

    Greetings,
    Yana
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Azim
    Azim avatar
    2 posts
    Member since:
    Dec 2012

    Posted 05 Mar 2013 Link to this post

    Hello Telerik Team,
    i have radcombo working with Filter="Contains" , but it is failing while user adding custom text in to combo box (which is not in combo), it is not validating , and returns empty.string in Code Behind.
    any Solutions how can i validate?

    Thanks in Advance !

    <telerik:RadComboBox ID="rcbCallTransfer" Runat="server" Filter="Contains" EnableLoadOnDemand="true" AutoPostBack="true
    EmptyMessage="Select Employee" AllowCustomText="false" MarkFirstMatch="true"
    EnableTextSelection
    ="true"  OnSelectedIndexChanged="rcbCallTransfer_OnSelectedIndexChanged">
                                </telerik:RadComboBox>
  4. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 08 Mar 2013 Link to this post

    Hi Azim,

    The provided information is not sufficient in order to determine what might caused the issue.  We will need more details about your scenario. Under which browser you had faced the issue and what is the version of Telerik assemblies that you are using? If you could provide us with a sample reproducing the problem or a code snippet demonstrating the entire implementation of the RadComboBox, it would be great appreciated. 

    All the best,
    Hristo Valyavicharski
    the Telerik team
    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 their blog feed now.
Back to Top