This question is locked. New answers and comments are not allowed.
<%=Html.Telerik().DatePicker()
.Name(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))
.HtmlAttributes(
new
{
id =ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty) +DateTime.Now.Millisecond
})
.Value(Model > DateTime.MinValue ? Model : DateTime.Today)
.InputHtmlAttributes(new { style = "width: 110px" })
%>
<
input
value
=
"7/12/2010"
style
=
"width: 110px;"
name
=
"StartDate"
id
=
"StartDate951-input"
class
=
"t-input"
autocomplete
=
"off"
>
I'm using Ajax binding with the Editor Template in an Telerik MVC Grid.
How do I get a JQuery reference to a DatePicker Control (in this example,called StartDate) that is being edited?
The following code works fine, but I obviously don't know the actual id as this is dynamic based on template (millisecs) above
var date1 = $('#StartDate951').data("tDatePicker").value();
As Id of the DateTimePicker is auto-generated, I need something less direct and was wondering if there is a JQuery that can pick up the current rows StartDate value WITHOUT knowing the suffix (in this case 951)
The telerik grid bound column is :
columns.Bound(o => o.StartDate).Width(170).Format("{0:ddd, dd MMM yyyy}");
thanks