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

GridHeaderComponent is null when I press apply button on a custom filter #384

Closed
AlexeyBoyko opened this issue Mar 17, 2023 · 7 comments
Closed

Comments

@AlexeyBoyko
Copy link

Hello, I am facing quite the same problem as described in this closed issue: #87
I am using the latest version of GridBlazor (3.5.2) and strictly follow the documented instructions.
Could you please check if this old issue had resumed at some point after version 1.3.17 (where it was obviously fixed)?

@AlexeyBoyko AlexeyBoyko changed the title GridHeaderComponent is null when I press apply button a custom filter GridHeaderComponent is null when I press apply button on a custom filter Mar 18, 2023
@AlexeyBoyko
Copy link
Author

AlexeyBoyko commented Mar 18, 2023

By the way, I've made a comparison of the code introduced by this commit (65b0caa) which meant to fix the #87 issue and it seems that the current state of respective code isn't much different, except for the the variable _sequence which was eliminated since and replaced with explicit numbers. So, if it is broken then it must be for some other reason... so I wonder what could it be?

@AlexeyBoyko
Copy link
Author

P.S. Just in case, my app is server-side Blazor, while in the original issue it was probably client side WASM (judging by the link to documentation provided in the question).

@gustavnavar
Copy link
Owner

I've tested some examples with custom filters in a server-side Blazor project. But they work fine.

By the way there is published sample here. The Customer column uses a custom filter with no errors.

Could you send a sample project including a grid that produces the error?

@AlexeyBoyko
Copy link
Author

AlexeyBoyko commented Mar 27, 2023

Thank you for the answer. I attach page's razor and cs files and the filter widget component.
dropDownFilter.zip. If the reason for the bug is not clear from these sources, I can make a separate sample project, just let me know.

@gustavnavar
Copy link
Owner

You are using UserGroup as generic type parameter of the DropdownFilter class in the page Users.razor.cs:

_customFilters.Add(filterWidgetName, typeof(DropdownFilter<UserGroup>));

You must use UserViewModel as generic type parameter:

 _customFilters.Add(filterWidgetName, typeof(DropdownFilter<UserViewModel>));

@gustavnavar
Copy link
Owner

gustavnavar commented Mar 28, 2023

By the way, I recommend using a new database context and a new repository for the GridCoreServer constructor for Server Blazor projects, mainly for CRUD support.

Read from this commentary

@AlexeyBoyko
Copy link
Author

Thank you kindly, it works!

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

2 participants