I've been working with the RadFilter, and have added a RadFilterTextFieldEditor to the RadFilter which is set to a DataType of System.Guid. When I pass the expression into a LinqDynamic query, it throws an exception:
ParseException:
Operator '==' incompatible with operand types 'Guid' and 'Object'
The RadFilter expression:
"(iif(it.UniqueId==null,\"\",it.UniqueId).ToString().ToUpper() = \"12345678-926F-44A9-936B-CDBB03DA888A\".ToUpper())"
Declarative code:
<telerik:RadFilterTextFieldEditor DataType="System.Guid" FieldName="UniqueId" DisplayName="Package Unique ID" />
Linq Query:
if (!string.IsNullOrEmpty(packageFilterExpression))
{
query = query
.Where(packageFilterExpression);
}
Note: I have researched this some and arrived at the following suggested workaround, however the suggestion to modify the LinqDynamic class in this case still doesn't work with the expression syntax generated by the RadFilter.
https://connect.microsoft.com/VisualStudio/feedback/details/333262/system-linq-dynamic-throws-an-error-when-using-guid-equality-in-where-clause
Additionally, when I add filtering to a RadGrid, to see how it generates a filter expression, I see that the expression is different, and consequently works.
The RadGrid expression:
"(UniqueId = Guid(\"12345678-926F-44A9-936B-CDBB03DA888A\"))"
Any assistance or verification the RadFilter actually works with a System.Guid would be appreciated!
Thanks!