I'm trying to use the MonthYearPicker as my control for filtering datetime. However, when I try the code below, I get:
String was not recognized as a valid DateTime.
I've tried formatting several ways with no luck. I was trying to
look at the event in the code behind, but I see no arguments at all that
contains my filter values themselves. Just the column name and
expression. Any help would be appreciated. Thank you!
<
FilterTemplate
>
<
telerik:RadMonthYearPicker
ID
=
"RadMonthYearPicker1"
runat
=
"server"
ClientEvents-OnPopupClosing
=
"MeasurementDateChanged"
/>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock3"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function MeasurementDateChanged(sender, args) {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
var year = args._picker.FocusedDate[0];
var month = args._picker.FocusedDate[1];
var fromDate = new Date(year, month-1, 1);
var toDate = new Date(year, month, 0);
tableView.filter("MeasurementDate", fromDate.toISOString() + " " + toDate.toISOString(), "Between");
}
</
script
>
</
telerik:RadScriptBlock
>
</
FilterTemplate
>