Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
how to set a decimal value to kendo numerictextboxfor
Cassie Mod
Nov 14 2017 6:11 AM
157
Reply
HI,
ive got the following question.
I have a kendo Numerictextbox. however the value is only set when it is an int. when it is a double is doesn't fill the numerictextbox, because he doesn't know what to do with the value after the. so it leaves it completely empty.
However how can i get this working? becuase it does need to set a decimal ( price of products). Eventually i need to set the value of m.UnitPrice in the numerictextbox.
here is my code.:
<div
class
=
"form-group"
>
@Html.LabelFor(model => model.UnitPrice,
new
{ @
class
=
"col-lg-3 col-md-3 col-sm-3 col-xs-3 control-label"
})
<div
class
=
"col-lg-4 col-md-4 col-sm-4 col-xs-4"
>
@(Html.Kendo().NumericTextBoxFor<
decimal
>(m => m.UnitPrice)
.HtmlAttributes(
new
{@
class
=
"k-numerictextbox"
})
.HtmlAttributes(
new
{style =
"width:100%"
})
.Min(-999999)
.Max(999999)
.Decimals(2)
.Value(12.3M)
)
@*@(Html.EditorFor(m => m.UnitPrice))*@
@Html.ValidationMessageFor(m => m.UnitPrice,
""
,
new
{@
class
=
"text-danger"
})
</div>
<div
class
=
"form-control-static col-lg-5 col-md-5 col-sm-5 col-xs-5"
>
per maand
</div>
</div>
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
how to send data post Request in asp.net my code here:
How to make intent to be dynamic