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

[Solved] CurrencyTextBox() Bug

2 Answers 103 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
lmf232s
Top achievements
Rank 1
lmf232s asked on 09 Sep 2010, 06:55 PM
I have a field in my grid that uses the CurrencyTextBox() EditorTemplate and just ran into an issue.

The value that is causing the error is:
$999,999.00

I recieve the following error:
Specified argument was out of the range of valid values.
Parameter name: Value should be bigger than MinValue and less than MaxValue.


Template:
<%= Html.Telerik(). CurrencyTextBox()
        .Name(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))
        .InputHtmlAttributes(new {style="width:100%"})
        .MinValue(0)
        .Value(Model)
%>

If I add a .MaxValue() property and set it well beyond what I need, all works as expected.

I can recreate this in the demos:
http://demos.telerik.com/aspnet-mvc/Grid/EditingServerSide?mode=InLine

Change any of the unit prices to anything over $1000, youll notice that you get a validation error on the page (Textbox gets highlighted red) but you can submit and it will udpate. Now try to edit this field and it will throw an error.

2 Answers, 1 is accepted

Sort by
0
lmf232s
Top achievements
Rank 1
answered on 09 Sep 2010, 07:02 PM
In looking at the source you have the MaxValue hardcoded to 1000

Telerik.Web.Mvc.UI.CurrencyTextBox - Line 23

Maybe this is by default..
0
Georgi Krustev
Telerik team
answered on 09 Sep 2010, 10:26 PM
Hello lmf232s,

This behavior is by design and is expected. If you need to allow bigger numbers than 1000, you just need to use MaxValue method and set your number.

Greetings,
Georgi Krustev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
lmf232s
Top achievements
Rank 1
Answers by
lmf232s
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or