Store / Restore Filters

2 posts, 0 answers
  1. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 15 Jan 2014 Link to this post

    Hi,

    my need is to store and restore Filter settings.
    The scenario - a grid with Names is in a dialog.
    The user (for an example) chooses "Joe" in the Firstname Column and "Doe" in the FamilyName column.

    Prior closing the Dialog I store the FilterDescriptors like this:
    //pFilterDescriptors is the FilterDescriptors collection from RadGridView
    //_FilterStore is a local CompositeFilterDescriptorCollection
    public void StoreFilter(Telerik.Windows.Data.CompositeFilterDescriptorCollection pFilterDescriptors) {
        if(_FilterStore != null) {
            _FilterStore.Clear();
            foreach(IFilterDescriptor o in pFilterDescriptors) {
                _FilterStore.Add(o);
            }
        }
    }

    The next time I open the dialog I restore these stored Values like this:
    //pFilterDescriptors is the FilterDescriptors collection from RadGridView
    //_FilterStore is a local CompositeFilterDescriptorCollection
    public void RestoreFilter(Telerik.Windows.Data.CompositeFilterDescriptorCollection pFilterDescriptors) {
        if(pFilterDescriptors != null) {
            pFilterDescriptors.Clear();
            foreach(IFilterDescriptor o in _FilterStore) {
                pFilterDescriptors.Add(o);
            }
        }
    }

    This works - but when I open the filter box only "Joe" can be found in the distinct values.
    "Clear Filter" on the column is also not working since the column nows nothing about filtering.

    What I need (expected) is:
       a.) Highlighted Filter Symbols in the filtered columns
       b.) Filtered Values available in the Filter Selector (also those not visible at the moment)

    Or in simple Words - the RadGridView should look / work like it did when I closed the dialog.

    Manfred
  2. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 15 Jan 2014 Link to this post

    Hi,

    I found the solution - http://www.telerik.com/help/wpf/gridview-filtering-howto-save-and-load-filter-settings.html

    Consider this as solved.

    Manfred
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top