This is a migrated thread and some comments may be shown as answers.
DatePicker and TimePicker with Editor Templates via Telerik Window
0 Answers 48 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bill
Top achievements
Rank 1
Bill asked on 19 Nov 2011, 10:15 AM
[Has anyone been able to make a TimePicker or DatePicker work via editor templates dropped on a Telerik window? When I try the controls show up but the buttons and input validation doesn't work.

The only workaround I have found so far is to replace one of the Editor Templates with the native Telerik control.

[View]
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> 
<% Html.EnableClientValidation();%>    
<div id="Win">
<% using (Ajax.BeginForm("Edit""Bar"new { BarId = Model.BarId },
new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "Win" }, new { id = "frmEdit_Bar" })) {%>


<%
: Html.Telerik().DatePickerFor(model => model.Date1)%>
<%: Html.EditorFor(model => model.Time1, "Time")%>
<br />                         
<%: Html.EditorFor(model => model.Date2, "Date")%>
<%: Html.EditorFor(model => model.Time2, "Time")%>
<br />
<%: Html.EditorFor(model => model.Date3, "Date")%>
<%: Html.EditorFor(model => model.Time3, "Time")%>
<p>     <input type="submit" value="Save"/> </p>     
<% } %>     
</div>

[Time.ascx]
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.DateTime?>" %> 
<%= Html.Telerik().TimePickerFor(m => m) %>

[Date.ascx]
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.DateTime?>" %> 
<%= Html.Telerik().DatePickerFor(m => m) %>

[Telerik Window]
<% Html.Telerik().Window()        
.Name("BarWin")
.Scrollable(true)        
.Width(500)        
.Height(600)        
.Modal(true)        
.Buttons(b => b.Maximize().Close())        
.Resizable()        
.Draggable(true)               
.Visible(false)  
.Render(); %>
Tags
Date/Time Pickers
Asked by
Bill
Top achievements
Rank 1
Share this question
or