The string comparison is case sensitive by design. The reason is that if one needs to make it insensitive, it can be easily achieved by applying ToLower
on both the left and right sides of the comparison.
But if the comparison was case insensitive and you needed sensitivity, your hands would be tied.
So in your case you can write an user defined function, for example:
public static string StringToUpper(object value)
if (null == value || System.DBNull.Value == value)
Then in the filter use:
=StringToUpper(Fields.MyField) = =StringToUpper(Parameters.MyParameter)
Also as an alternative of the user defined function you can use the string.ToUpper
method directly in the expression but you need to ensure a not null value. Something like:
=CStr(IsNull(Fields.MyField, "")).ToUpper() = =CStr(IsNull(Parameters.MyParameter, "")).ToUpper()
As for the Like operator to work, in the right side of the operator you need to use some wild card symbol(s), just like in SQL, something like:
=StringToUpper(Fields.MyField) Like ="%" + StringToUpper(Parameters.MyParameter) + "%"
Try it out and write us if you need further assistance.
More info on User defined functions, operators, etc. you can find in the help topic Using Expressions
the Telerik team
Check out Telerik Trainer
, the state of the art learning tool for Telerik products.