Filtering ListView

5 posts, 0 answers
  1. Tino
    Tino avatar
    86 posts
    Member since:
    Jul 2017

    Posted 17 May 2018 Link to this post

    Quick question about filtering. I have a ListView with several columns including a checkbox column. I want to filter the listview on one column ("Title'), based on a textbox value as the user types. I thought the below might work, but it doesn't seem to work, the filtering doesn't look right. Please tell me why this approach doesn't work. Thanks.

    Code to add the filter:

    private FilterDescriptor _valueFilter;
    _valueFilter = new FilterDescriptor("Title", FilterOperator.Contains, "");
    lstvwLookups.FilterDescriptors.Add(_valueFilter);

     

    Code to update the filter:

    private void txtFilter_TextChanged(object sender, EventArgs e)
    {
        _valueFilter.Value = ((TextBoxChangedEventArgs)e).Text;
    }
  2. Tino
    Tino avatar
    86 posts
    Member since:
    Jul 2017

    Posted 17 May 2018 Link to this post

    Never mind, I found the error. I was filtering on e.Text instead of sender (as RadTextBoxControl) Text.
  3. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3575 posts

    Posted 17 May 2018 Link to this post

    Hello, Tino,     

    I am glad that the problem you were facing is now resolved. Additional information about the filtering functionality in RadListView is available in the following help article: https://docs.telerik.com/devtools/winforms/listview/features/filtering

    You can also have a look at the Demo application >> ListView >> First look example which provides a filter box as well.

    I hope this information helps. If you have any additional questions, please let me know. 

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  4. Tino
    Tino avatar
    86 posts
    Member since:
    Jul 2017

    Posted 17 May 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Thanks yes I saw that of course but it doesn't show a filter-as-you-type sample which is what I was after.
  5. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3575 posts

    Posted 21 May 2018 Link to this post

    Hello, Tino,     

    In the Demo application >> ListView >> First look example there is a filter box which demonstrates a filter as you type example which uses the FilterDescriptor instance to perform filtering. 

    I hope this information helps. If you have any additional questions, please let me know. 

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top