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

[Solved] Date Picker EditorTemplate does not work in Grid

2 Answers 149 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Frank Michael
Top achievements
Rank 1
Frank Michael asked on 01 Jun 2010, 11:48 AM
I have a Grid and an Editor Template for a DatePicker, which does not work.

Here is the sample Project:

http://cid-a7d5afee7d992a7a.skydrive.live.com/self.aspx/Telerik/DatePickerProblem.zip

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 01 Jun 2010, 01:19 PM
Hi Frank Michael ,

The problem is caused by the generated ID of the datepicker. You can try to modify datepicker in Date.ascx like so:
<%= Html.Telerik().DatePicker()
        .Name(ViewData.TemplateInfo.HtmlFieldPrefix)
        .HtmlAttributes(new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("") + DateTime.Now.Millisecond.ToString()})
        .Value(Model > DateTime.MinValue? Model : DateTime.Today)
%>

Best wishes,
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.
0
Frank Michael
Top achievements
Rank 1
answered on 01 Jun 2010, 01:42 PM
Great, thanks!
Tags
Grid
Asked by
Frank Michael
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Frank Michael
Top achievements
Rank 1
Share this question
or