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

RadGrid filter issue

1 Answer 110 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Benjamin
Top achievements
Rank 2
Iron
Iron
Veteran
Benjamin asked on 09 Apr 2021, 11:19 AM

I having having some issue with the filter of RadGrid. 

When i type ‘ the result is showing no data found which is what i wanted.

but if i type something like abc.get(‘abc’); or â€˜) OR 1=1 -- the filter textbox get cleared and all result is shown. Would like to check other than this, is there anyway to not clear the filter textbox and for the result to show no data found instead?

1 Answer, 1 is accepted

Sort by
0
Accepted
Attila Antal
Telerik team
answered on 14 Apr 2021, 08:44 AM

Hi Benjamin,

For security reasons, some of the characters/keywords are considered illegal strings in the Grid. 

If you prefer to override that you can change the IllegalStrings array and remove the characters you would like to use, see Filter grid with quotes, AND, OR or other special symbols

For example, you can exclude the OR keyword:

protected void Page_Load(object sender, EventArgs e)
{
    GridFilterFunction.IllegalStrings = new string[] { " LIKE , AND , \",>,<,<>, NULL , IS " };
}

 

The results will be as you described:

 

Regards,
Attila Antal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Benjamin
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Attila Antal
Telerik team
Share this question
or