Filter by Date Range using two date pickers

I have an inline datagrid that I am filtering based on user entered values in start and end datepickers and a store ID number (I have data from four stores, so each has a unique number) It works wonderfully. I also want to be able to reset the filter based on today. This also works fine until I start navigating the datagrid. If I move to the second page of data, when I hit the reset button I created, it creates an empty filter. All I did was set the properties of the start and end datepickers to DateTime.Today and the Store number. Then I filtered the results.

Here is the click event

How can I do this and retain the correct start and end dates and the store number?

What is empty filter?

What does that mean?

In general try running the application through visual studio and inspect with a debugger what the query parameters are.

When I execute the click event, the start and end dates and the storeno get set to zero, even those I have those properties set to todays date and the correct store number. Only occurs when I use paging on datagrid.

The click event should set those properties. They cannot be set to zero as zero is not a valid DateTime value.

What happens when you debug the Click event handler? Can you show a screenshot showing how start and end are set to zero?

It seems that is is a problem with the paging feature. If I disable it, there is no issue. When I enable paging, the paging buttons cause the start and end to reset to a date outside any dates in the table. Without paging everything works perfectly.

Paging does not trigger the Click event of the Button where those dates are set (judging from the information provided so far). I am afraid I still don't understand what the problem is. Let's start from the beginning. How are those two dates used by the DataGrid? You can attach a screenshot showing how you use them in Radzen. The one provided so far only shows how you set them in the Click handler of a button.

Start with filter on load event that is >= DateTime.Today and <=DateTime.Today

This is the result.

After clicking filter button which triggers click event

This is the result

without paging

after hitting reset

(didn't put in an data other than date just for example)

Now with paging enabled

After clicking filter button which triggers click event

Then changing to page 2

Then clicking Reset button that triggers the reset button click event

page load

filter button click event

reset button click event

It works fine without the paging enabled.

If it works fine without paging then probably you need to reset the current grid page as well. Try adding the following Execute C# action in the Reset Button Click handler (assuming the Name of your DataGrid is grid0)

await grid0.FirstPage();

Wow...that was so simple...thank you!