Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set filter programmatically #117

Closed
sraedler opened this issue Aug 10, 2023 · 7 comments
Closed

Set filter programmatically #117

sraedler opened this issue Aug 10, 2023 · 7 comments

Comments

@sraedler
Copy link

sraedler commented Aug 10, 2023

I would like to filter a column by a value, but with the possibility to continue filtering or to display the removed values afterwards via the GUI.

With the "LoadFilterAndSort" it is not possible to adjust the filters afterwards.

Is there a way to make this possible? I did not find anything in the sample.

Edit: Basically, I want to programmatically set a filter with the same behavior as in the GUI dropdown.

@davidegironi
Copy link
Owner

Hello, take a look here: #79

@sraedler
Copy link
Author

Unfortunately, it is not what I intend to do.

I want to display a table when starting an application. The table contains entries where one column contains a Boolean value. This shows if the record in this row is completed.

When starting the application I want to display only complete records, but give the user the possibility to display all records available (incl. uncompleted ones).

With the CleanFilterAndSort method this would be possible, but then I need an extra button or control to unload the filter, right?

@davidegironi
Copy link
Owner

Due to internal ADGV strcuture it's not possible to set a filter pragmatically. It's something I want to add, but currently I don't have the time to do this.
To achive your goal there's two things that comes in to my mind:

  1. you can override the On Filter changed event, to and built some custom code there
  2. in my opinion the simpler and claner way to do this is to filter the datasource, putting a filter on "top" of adgv loading. If you look as example at the dentned project (https://github.com/davidegironi/dentned) you can find on many forms a datasource filter (on view is top left).

@sraedler
Copy link
Author

Thanks for helping!

@peros550
Copy link

Hi David, did you have time to check this feature? It would be a very nice addition.

@davidegironi
Copy link
Owner

Hello @peros550 , unluckily not yet.

@peros550
Copy link

no wories, I just followed your advice above and filtered the data one step before I pass them to the Datagridview. Having the option to work with datagridview's UI , in terms of filtering, would be great. All the best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants