I am using RadFilter on a page connected to a RadGrid in the simplest way. The RadGrid built in filter generates a correct filterexpression for use in dynamic linq. However the RadFilter gets everything correct except for the fact that the field names are prefixed with "it."
I also decompiled the RadFilter and related code and came across the following code in which it appears that the "it" prefix is very intentional and also very hard-coded. This is forcing me to put in an event handler to search for the prepended 'it' and remove it. What is happening here?
:
public string FormatFieldName(string fieldName, Type dataType, bool isCaseSensitive)
{
dataType = RadFilterTypeHelper.GetNonNullableType(dataType);
if (dataType == typeof (string))
{
string str = isCaseSensitive ? "" : ".ToUpper()";
return string.Format("iif(it.{0}==null,\"\",it.{0}).ToString(){1}", (object) fieldName, (object) str);
}
if (!(dataType == typeof (char)))
return string.Format("it.{0}", (object) fieldName);
string str1 = isCaseSensitive ? "" : ".ToUpper()";
return string.Format("Char(iif(it.{0}==null,'''',it.{0})).ToString(){1}", (object) fieldName, (object) str1);
}