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

Filter throws exception - can I catch it?

5 Answers 136 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Scott Monsees
Top achievements
Rank 1
Scott Monsees asked on 27 Sep 2007, 05:44 PM
I have a text column in my grid, showing integer values.  I have the filter function set to EqualTo.  If the user enters in something like "1 3" (no quotes) I get an EvaluationException (coming from the DataTable I believe).  Is there anyway to catch this?  It kicks the user all the way out to the login.

TIA

5 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 28 Sep 2007, 04:11 PM
Hello Scott,

We did some tests with integer columns and found a problem related to formatting and filtering of values with spaces. Sorry for the inconvenience.

We will research the problem and will do our best to fix it for SP1 Q2 release. Thank you for the feedback and check your Telerik points for update.
 
 
Kind regards,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jan Hesselgren
Top achievements
Rank 1
answered on 09 Jun 2008, 07:21 AM
Hello.

I am experiencing a similar problem with the 2008 Q1 SP1 Release:

If I type "a * t" in the filter, it throws an exception:
Error in Like operator: the string pattern '%a * t%' is invalid.

Is there a way to generally catch filter exceptions and transform invalid filters into valid ones? Or perhaps inform the end-user in a more user-friendly way?

Thanks in advance.
0
Jordan
Telerik team
answered on 09 Jun 2008, 01:58 PM
Hello Jan Hesselgren,

There is currently no way to catch the filter expression errors. We have planned this feature for the upcoming 2008 Q2 release. In the meantime you could try checking the filter values that users enter by handling the ValueChanging event of RadGridView like this:
void radGridView1_ValueChanging(object sender, ValueChangingEventArgs e) 
        { 
            if (this.radGridView1.ActiveEditor != null && 
                this.radGridView1.CurrentCell is GridFilterCellElement) 
            { 
                if (this.radGridView1.ActiveEditor.Value != null && 
                    this.radGridView1.ActiveEditor.Value.ToString().Contains("*")) 
                { 
                    this.radGridView1.ActiveEditor.Value = null
                    this.radGridView1.CancelEdit(); 
                } 
            } 
        } 

Hope that helps.

Regards,
Jordan
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jan Hesselgren
Top achievements
Rank 1
answered on 10 Jun 2008, 07:11 AM
Thanks, this worked as expected.

When is the 2008 Q2 release planned?
0
Kiril
Telerik team
answered on 10 Jun 2008, 07:28 AM
Hi Jan Hesselgren,

I'm glad to hear the issue has now been addressed.

The Q2 2008 release is planned for the second half of next month.

Greetings,
Kiril
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Scott Monsees
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Jan Hesselgren
Top achievements
Rank 1
Jordan
Telerik team
Kiril
Telerik team
Share this question
or