This is a migrated thread and some comments may be shown as answers.

Store / Restore Filters

1 Answer 89 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ManniAT
Top achievements
Rank 2
ManniAT asked on 15 Jan 2014, 12:50 PM
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

1 Answer, 1 is accepted

Sort by
0
ManniAT
Top achievements
Rank 2
answered on 15 Jan 2014, 02:21 PM
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
Tags
GridView
Asked by
ManniAT
Top achievements
Rank 2
Answers by
ManniAT
Top achievements
Rank 2
Share this question
or