This is a migrated thread and some comments may be shown as answers.

Why is this column converting the filter value to upper case?

2 Answers 232 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Iron
Iron
Andrew asked on 28 Feb 2012, 05:03 AM
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:

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?




   

2 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 02 Mar 2012, 09:08 AM
Hi,

Do you have by any chance this setting in RadGrid declaration:

<GroupingSettings CaseSensitive="false" />

If this is the case try set it to true and check whether the issue is resolved. If not, please share your RadGrid declaration along with the respective event handlers.

Greetings,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Andrew
Top achievements
Rank 1
Iron
Iron
answered on 05 Mar 2012, 07:03 AM
Right first time! So the solution was to set CaseSensitive to true, or even better remove the  GroupingSettings element altogether because I wasn't enabling grouping anyway.

 

Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Iron
Iron
Answers by
Andrey
Telerik team
Andrew
Top achievements
Rank 1
Iron
Iron
Share this question
or