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

Filter does not work when Coulmn name contain special characters like $,&,">

1 Answer 502 Views
Grid
This is a migrated thread and some comments may be shown as answers.
subrat
Top achievements
Rank 1
subrat asked on 01 Jul 2015, 01:08 PM

I am using custom filter in my radgrid. I am creating the filter column like this:

FilterColumn : GridBoundColumn

{

//othercode

_filterCombo = new RadComboBox()
                              {
                                  ID = "filterCombobox" + this.UniqueName,

                                  OnClientItemsRequested = "OnClientItemsRequestedHandler",
                                  OnClientDropDownOpening = "OnClientItemsRequestedHandler",

                                  //other code

                             }

 _filterCombo.SelectedIndexChanged += filterCombo_SelectedIndexChanged;
 _filterCombo.ItemsRequested += filterCombo_ItemsRequested;

//othercode

}

When the column name contain special characters like $,& ] etc the filter does not work.

I have noticed that in this case neither OnClientDropDownOpening nor ItemsRequested event fires.

 I have tried the solution in the thread http://www.telerik.com/forums/grid-mastertableview-filterexpression-is-blank-on-special-chars-like-quot-lt-gt-is-passed-from-google-like-filtering. but this is not working.

I am still not able to filter even after making the changes mentioned in the above thread.

 Also when my column name contains "> (e.g te">stcolumn ), than the grid fails to show the combobox. Instead it shows html and textboxes.

It correctly shows the combobox if I htmlencode the above column name but filtering still does not work even after setting IllegalStrings and EnableLinqExpressions in page_load event.

GridFilterFunction.IllegalStrings = new string[] { " LIKE ", " AND ", " OR ", " NULL ", " IS " };
            rg_Report.EnableLinqExpressions = true;

 My telerik.UI version is 2014.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 06 Jul 2015, 09:10 AM
Hello Subrat,

Try to disable the EnableLinqExpressions property, but please keep in mind that changing the illegal strings can be risky:
http://www.telerik.com/forums/radgrid-filter-with-and-and-or#iMR601r2eUqBd4tiWXBrWg

Hope this helps.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
subrat
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or