Pre-Set Gridfilter on page load

I already asked this question some time ago, but since I'm again in a similiar situation and can't get something useful out of the old forum posts:

How can I set an initial filter on page load which the user can remove by just clearing the the set value in the filter-row on top of the grid?

I have set a FilterValue in the grids properties (Columns-Popup) which works well for the visuals.

But I still can't create a working filter on the grids load event.
I tried this:
${event.filter ? event.filter : 'ID eq ' + preselectedID}
but it leads to the following problem:

When the user clears his filters, the grid shows exactly one entry, which was indeed wanted when the page loaded, but not anymore after the user starts to filter for something else in the grid.

I can't distinguish between a filter not being in the event because

  • the user cleared his inputs
  • the page just loaded for the first time

Thanks in advance
Moo

1 Like

btw, do you know that the videos you embed on that site can't be clicked on? (so no full-screen, or sharing, link to youtube etc. basically a blurry moving mess which can't be consumed without starting your browsers inspector first)

I have an additional question: Does this solution mean I have to make the db-call for all data in the table twice? That would have a huge performance impact in my case (fetching >10000 db-entries).

No. The article describes how to set filter for both database method invokes in Page Load and DataGrid LoadData however in the page is created using current version of Radzen only one database method invoke will be used - in DataGrid LoadData. The template was optimised at some point to just call this.grid0.load() in Page Load.

1 Like