New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Filter RadGrid with quotes, AND, OR or other special symbols

Updated over 6 months ago

Description

RadGrid control considers quotes, "AND", "OR" and other similar meaningful statements in query context as illegal when filtering. These are the default values of this collection:

{ " LIKE ", " AND ", " OR ", "\"", ">", "<", "<>", " NULL ", " IS " }

Solution

You can remove the "AND" and "OR" statements from the forbidden filter string collection. This could be achieved in the Page_Load() event handler as following:

C#
protected void Page_Load(object sender, EventArgs e)
{
    GridFilterFunction.IllegalStrings = new string[] { " LIKE ", ">", "<", "<>", " NULL ", " IS " };
    RadGrid1.EnableLinqExpressions = false;
}

Telerik does not bear responsibility when you change this collection.

If you are using CheckList or HeaderContext (Excel-like) filtering mode, you can additionally set the following property:

ASPX
<telerik:RadGrid ... >
    <FilterMenu EnableTextHTMLEncoding="false"></FilterMenu>
In this article
DescriptionSolution
Not finding the help you need?
Contact Support