FilterValue against a date field

I have a DataGrid and one of the column within which is a date field. I'd like to set a filter on the column to only return the records which have today's date in this column when the page is first opened.

It appears that I should be using the "FilterValue" property on the column but, I am struggling to get this to work. I've tried binding this property to a page variable or (for a test) just entering the today's date into the FilterValue property field wrapped in single quotes but, with no joy. I either see the date in data grid's filter field at runtime and get no data back or, the page won't compile.

I presume I'm not setting this property correctly to do what I want so, can you give me some pointers? I've got the column setup as follows:


I've defined InitialDateFilter in the page Load handler and tried giving is various values such as 'EQ 12/11/2020', '12/11/2020' and ${new Date().toDateString()} all without success

Hi @markb,

Please check this article on how to provide default filter:

Hi @enchev

Thanks for that and I've got this working perfectly up to a point. If I test it on a field which is a string or a number, I can get the initial filtering to work per the link you provided and if I set the columns FilterValue to the defaultOrderID property, it displays the value within the datagrid's filter selection row which is perfect.

However, if I try to use a date field, I get an error in Chrome:

Is there anything different that I should be doing for a date field? The filtering works fine but, getting the filtered value to show in the datagrid's filter selection row seems to be the sticking point?

According to the error error the value is most probably string not JavaScript Date object