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

NumericTextBox with null values

2 Answers 1161 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Tomasz
Top achievements
Rank 1
Tomasz asked on 17 Jan 2013, 11:57 PM
I have a Model which contains a property
public decimal? CountedStockQuantity {get;set;}

I bind this property to grid column like this:
columns.Bound(col => col.CountedStockQuantity).EditorTemplateName("FixedNullableDecimal").Width(120).ClientTemplate("#= (CountedStockQuantity == null) ? ' ' : CountedStockQuantity #");

I use a editor template :
@model  decimal?
            
 @(Html.Kendo().NumericTextBoxFor(m => m)
      .HtmlAttributes(new { style = "width:100%" })
      ) 

When I leave an empty value in control, validation occur
The field Counted qty. must be a number.

How do I need to build an template editor to avoid this validation ?

2 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 21 Jan 2013, 11:46 AM
Hello Tomasz,

Are you sure that you have not added the [Required] datatype attribute? I am not able to reproduce such behavior on my side. Please check the attached project and modify and send back if I missed something.


Kind regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Tomasz
Top achievements
Rank 1
answered on 22 Jan 2013, 02:40 PM
I upgrade my Kendo version to the latest release and it seems to work fine.
Thanks
Tags
NumericTextBox
Asked by
Tomasz
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Tomasz
Top achievements
Rank 1
Share this question
or