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

Not able to bind value to datepicker control

1 Answer 344 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ASAP Developer
Top achievements
Rank 1
ASAP Developer asked on 23 Oct 2013, 04:21 PM
Hi There,
I need to use datapicker control in a tabstrip which is in a grid control. I am trying to bind date value to my datapicker control but it's coming as blank.
Following are different ways i have tried:

1:
tml.Kendo().DatePicker()
.Name("datepicker")
.Value("\\#= storageCharge.storageEndDate #\\")
.HtmlAttributes(new { style = "width:100px" }).ToClientTemplate()
)

And

@(Html.Kendo().DatePicker()
.Name("datepicker")
.Value("#= storageCharge.storageEndDate #")
.HtmlAttributes(new { style = "width:100px" }).ToClientTemplate()
)

Also if i bind the same way to a input control it works:

<input type="text" onchange="javascript:calcStorageFees()" value="#= storageCharge.storageEndDate #" id="strDate" on name="strDate" />

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 25 Oct 2013, 10:15 AM
Hello,


You could try the same approach as the one with input through the HtmlAttributes method.
E.g.
.HtmlAttributes(new { value = "#:kendo.toString(endDate, 'd')#" })

I hope that this information was helpful.

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
ASAP Developer
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or