I have created a custom grid column, so that I can create my own filter control (a combo box).
This was working well, but at some point it stopped working.
After a day of debugging, I've honed in on the problem.
In my case, the field name is "CompanyName", and the user has set the filter value to be "Acme".
The function GridColumn.EvaluateFilterExpression is returning the string:
CompanyName = "Acme".ToUpper()
Obviously, I don't want to convert the string to upper case.
I've overridden the function "EvaluateFilterExpression" as so:
And the debug output is:
--- GridHyperlinkColumnWithComboFilter.EvaluateFilterExpression(Telerik.Web.UI.GridFilteringItem)
--- GridHyperlinkColumnWithComboFilter.GetCurrentFilterValueFromControl - returning "Acme"
--- GridHyperlinkColumnWithComboFilter.EvaluateFilterExpression(Telerik.Web.UI.GridFilteringItem) returning "CompanyName = "Acme".ToUpper()"
I've scoured all of the properties of the grid and the column, but can't figure out why "ToUpper" is appearing in the filtering expression.
What would be causing the method "Telerik.Web.UI.GridColumn.EvaluateFilterExpression" to think I want to convert my filter value to upper case?
This was working well, but at some point it stopped working.
After a day of debugging, I've honed in on the problem.
In my case, the field name is "CompanyName", and the user has set the filter value to be "Acme".
The function GridColumn.EvaluateFilterExpression is returning the string:
CompanyName = "Acme".ToUpper()
Obviously, I don't want to convert the string to upper case.
I've overridden the function "EvaluateFilterExpression" as so:
public
override
string
EvaluateFilterExpression(GridFilteringItem filteringItem)
{
System.Diagnostics.Debug.WriteLine(
string
.Format(
"--- GridHyperlinkColumnWithComboFilter.EvaluateFilterExpression({0})"
, filteringItem));
var rv =
base
.EvaluateFilterExpression(filteringItem);
System.Diagnostics.Debug.WriteLine(
string
.Format(
"--- GridHyperlinkColumnWithComboFilter.EvaluateFilterExpression({0}) returning \"{1}\""
, filteringItem, rv));
return
rv;
}
And the debug output is:
--- GridHyperlinkColumnWithComboFilter.EvaluateFilterExpression(Telerik.Web.UI.GridFilteringItem)
--- GridHyperlinkColumnWithComboFilter.GetCurrentFilterValueFromControl - returning "Acme"
--- GridHyperlinkColumnWithComboFilter.EvaluateFilterExpression(Telerik.Web.UI.GridFilteringItem) returning "CompanyName = "Acme".ToUpper()"
I've scoured all of the properties of the grid and the column, but can't figure out why "ToUpper" is appearing in the filtering expression.
What would be causing the method "Telerik.Web.UI.GridColumn.EvaluateFilterExpression" to think I want to convert my filter value to upper case?