question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Saving and resetting filters

See original GitHub issue

Hi all,

I am working on a project, where it would be nice to save the filters that are currently selected. I can then save and load filter presets, which is nice to have in certain use-cases.

Currently, it was easy to get the filters by creating a public property for the criteria list. But when I try to set the criteria list again. It is not updating all the filters and the view again. Can anybody help me with this implementation?

Currently, I edited something like this in the Filterdatagrid.cs:

public Dictionary<string, Predicate<object>> Filters
{
    get => criteria;
    set
    {
        // reset criteria List
        criteria.Clear();
        GlobalFilterList.Clear();
        
        criteria = value;

        CollectionViewSource = System.Windows.Data.CollectionViewSource.GetDefaultView(ItemsSource);
        if (CollectionViewSource.CanFilter) CollectionViewSource.Filter = Filter;
        CollectionViewSource.Refresh();


        OnPropertyChanged(nameof(Filters));
    }
}

I can get the filters by requesting FilterDataGrid.Filters, but when setting, it will not work.

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
BEDIRHANSAMSAcommented, May 5, 2023

I can contirbute this

1reaction
macgilecommented, May 5, 2023

Hi

How it works ? If it works it may be useful for other users and I will integrate this new feature

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Reset All Filters in Power BI
Resetting filters is a simple yet powerful feature that can save you time and ensure that your data is always presented accurately.
Read more >
Filters on Beta Dashboard resetting
I often have a problem with Beta Dashboards where I would edit a filter for the dashboard but the changes do not get...
Read more >
Solved: How can a customer save a filter for future use in...
Hello! I'm looking for a solution that allows a customer to filter requests in the customer portal, and save this filter for future...
Read more >
Filter and/or Search Feature Enhancements
If the search function is robust, it may remove the need for the filter request as the search function would be sufficient.
Read more >
How-to Add Button to Reset Filters to Default (Video Tip)
File a feature request with our support team for another alternative. Tell your users that their requests are not important to you. This...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found