When I try to filter a column of type DateTimeOffset, I get an error like: "System.InvalidCastException: Invalid cast "System.DateTime" to quot;System.DateTimeOffset"."
Please tell me how to solve this problem. Thank you!
2 Answers, 1 is accepted
answered on 11 Jun 2014, 07:05 AM
This is not currently supported. The DataSourceRequest will always create a DateTime and not a DateTimeOffset. You should use a DateTime property in order to avoid the exception. If this is not possible in your scenario then I can suggest to convert the filter value to DateTimeOffset in the request filters e.g.
public static class Extensions
public static void MapFilters(this IList<IFilterDescriptor> filters, Action<FilterDescriptor> action)