RadSearchBox filter - Dinstinct Values only

2 posts, 0 answers
  1. Mashrukh
    Mashrukh avatar
    1 posts
    Member since:
    Nov 2015

    Posted 24 Nov 2015 Link to this post



    I am working with the rad search box, and my code on the view page looks like:

    <telerik:RadSearchBox ID="rsbCode" runat="server"
                              EmptyMessage="Search Options" Skin="Office2010Silver"
                              Width="460" DropDownSettings-Height="300" 
                              DataValueField="Code" >

     The data source I am pulling from has a list of employees each with a code number. Each employee has a code number, but different employees can have the same code number. This causes an issues with the search box, as the filter will show multiple values. 

    For example, if 3 different employees has the code number 2100. As I type '21' on the RadSearchBox, the 2100 will appear 3 times. How can I make the filter only show distinct values, such that 2100 will only appear once?


    Thanks very much for your help

  2. Nencho
    Nencho avatar
    1665 posts

    Posted 27 Nov 2015 Link to this post

    Hello Mashrukh,

    I would suggest you to subscribe for the OnDataSourceSelect event of the control, which is design to be used in exactly such scenarios, where you need to alter the query to your database (with Distinct for example).

    Please refer to the following documentation article, demonstrating the usage of the event:


    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top