If the Page culture is set to anything other than "en-US", RadDatePicker in the HeaderContextMenu will loose the correct format and swaps the Day with the Month after filtering.
Thank you for taking the time to report this issue!
This issue can be worked around by accessing the DatePickers and re-set their values to reflect the ones from the column.
Wire up the ClientSettings - OnHeaderMenuShowing and HeaderContextMenu - OnClientShown event handlers to the RadGrid:
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
>
<
ClientSettings
>
<
ClientEvents
OnHeaderMenuShowing
=
"menuShowing"
/>
</
ClientSettings
>
<
HeaderContextMenu
OnClientShown
=
"menuShown"
>
</
HeaderContextMenu
>
</
telerik:RadGrid
>
<script type=
"text/javascript"
>
var
gridCol;
function
menuShowing(sender, args) {
gridCol = args.get_gridColumn();
}
function
menuShown(sender, args) {
if
(gridCol._data.ColumnType ==
"GridDateTimeColumn"
) {
var
container = $(
"#"
+ sender.get_id() +
"_detached"
);
var
firstPicker = $telerik.findControl(container[0],
"HCFMRDPFirstCond"
);
var
regex = /[^\w]/gi;
if
(gridCol._data.CurrentFilterValue ==
""
) {
firstPicker.clear();
}
else
{
var
splitBy = regex.exec(gridCol._data.CurrentFilterValue);
// returns either dot " . " or " / " or " - "
var
firstDateDetails = gridCol._data.CurrentFilterValue.split(splitBy);
var
firstDate =
new
Date(firstDateDetails[2], firstDateDetails[1] - 1, firstDateDetails[0]);
firstPicker.set_selectedDate(firstDate);
}
var
secondPicker = $telerik.findControl(container[0],
"HCFMRDPSecondCond"
);
if
(gridCol._data.AndCurrentFilterValue ==
""
) {
secondPicker.clear();
}
else
{
var
splitBy = regex.exec(gridCol._data.AndCurrentFilterValue);
// returns either dot " . " or " / " or " - "
var
secondDateDetails = gridCol._data.AndCurrentFilterValue.split(splitBy);
var
secondDate =
new
Date(secondDateDetails[2], secondDateDetails[1] - 1, secondDateDetails[0]);
secondPicker.set_selectedDate(secondDate);
}
}
}
</script>