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

[Solved] Limit length of input in Filter textbox

0 Answers 10 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dave
Top achievements
Rank 1
Dave asked on 22 Jun 2012, 04:51 PM
Hi,

I'd like to know how I can limit the length of the characters you can enter in a textbox for the Grid Filter.  If I enter too many characters when using a number field (i.e. Int32 or Int64), I can reproduce a "Error! The requested URL returned 404 - Not Found".  This seems to be because you are trying to parse input that is longer than the Type defined for the entry.  I.e. an Int32 will crash at Int32.MaxValue + 1. 

I can reproduce this in your Online Demo for the Grid - http://demos.telerik.com/aspnet-mvc/grid
1. Go to the filter for the 'OrderId' column
2. Enter 2147483648 (Int32.MaxValue + 1) in the text field and click Filter
3. you receive the above error

I have "hacked" around this by using Int64 since I don't know how to limit the length of the input field you can enter.  You might also want to provide a more helpful/descriptive error message!

Any assistance is appreciated.

dave
Tags
Grid
Asked by
Dave
Top achievements
Rank 1
Share this question
or