Suggestive Filter Column

2 posts, 0 answers
  1. Jeff Miller
    Jeff Miller avatar
    2 posts
    Member since:
    Sep 2012

    Posted 08 Aug 2008 Link to this post


    RadControls version

    .NET version

    Visual Studio version

    programming language

    browser support

    all browsers supported by RadControls

    This is an extension to the (ID#696) "Google suggest" style filtering in RadGrid filter example.  This project uses ideas from the aforementioned example heavily but puts the relative code in a custom column type inherited from the GridBoundColumn.

    To implement you:
    1. Create a new class that inherits from the GridBoundColumn
    2. Create a viewstate string array to contain any distinct string values for the column.
    3. Override the SetupFilterControls, SetCurrentFilterValueToControl, GetCurrentFilterValueFromControl methods replacing the normal filter textbox with the radComboBox just as in the previous example, with the addition of wiring up the OnDataBound for the owner
    4. In the Owner's DataBound, loop through the datasource and look for the property on the object that is the Datafield of the column, or loop through a datatable's column of the same name and add any values you do not already have to the distinct string alue array.
    5. In the ComboBox ItemsRequested we bind it to the distinct values for the colum.
    6. For ease of clearing the filter, you may add a "Clear" button that would clear the column's filter by setting the ComboxBox.Text to empty string and clearing the CurrentFilterValue and CurrentFilterFunction properties

  2. Sebastian
    Sebastian avatar
    9934 posts

    Posted 03 Sep 2008 Link to this post

    Hello Jeff,

    Thank you for submitting this custom version of the online demo in the code library section on our site - we really appreciate your involvement and updated your Telerik points for that.

    Best regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top