Hi Steve, where do I fing Michael's TimePicker and I'll have a go [:D] (I have my own time picker but I havent quite finished it [:$]) but post the link here and I'll set it up and see if I can make it work [:D]
Dynamic Data
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
I have it embedded in a custompage (~/DynamicData/CustomPages/{MyTableName}/ListDetails.aspx)
I really am a bit stumped.. There is some speculation it might be java namespace clash ? At any rate it's the best timepicker I have found so far and I would really like to see it work. Having said that if you have one in the mix i'd love to have a look
at that too.
Oh and I must say I love your site, it's been extremely helpful to me. It is appreciated.
Rgds
Steve Mew
Microsoft Redmond Alumni - WinXP / SQL Server (#90903)
<PagerStyle CssClass="footer" />
<SelectedRowStyle CssClass="selected" />
<PagerTemplate>
<asp:GridViewPager runat="server" />
</PagerTemplate>
<EmptyDataTemplate>
There are currently no items in this table.
</EmptyDataTemplate>
</asp:GridView>
public class DateMetadata
{
[UIHint("CalendarDateTime")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
public object Date;
[UIHint("TimePicker")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:t}")]
public object StartTime;
It could be that when it is used in the FieldTemplate that the javascript libraries are not being referenced correctly [:(] and puttin a copy on the relavent page but not using it is giving it the correct javascript refs.
Dynamic DataCustom Field Templates
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
steve_mew
Member
8 Points
21 Posts
TimeSelector does not allow interaction in Edit Mode <mkb:TimeSlector (MichaelKBell)
Oct 14, 2009 12:53 AM|LINK
I have included Michael's TimePicker into my Dynamic Data Web Site.
New FieldTemplate :
<%@ Control Language="C#" CodeBehind="TimePicker_Edit.ascx.cs" Inherits="DynamicData01.TimePicker_Edit" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="TimePicker" Namespace="MKB.TimePicker" TagPrefix="mkb"%>
<asp:ScriptManagerProxy runat="server" ID="ScriptManagerProxy1" />
<asp:TextBox Visible="false" Width="60px" ID="TextBox1" runat="server" CssClass="droplist" Text='<%# FieldValueEditString %>' Columns="20"></asp:TextBox>
<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" CssClass="droplist" ControlToValidate="TextBox1" Display="Dynamic" Enabled="false" />
<asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator1" CssClass="droplist" ControlToValidate="TextBox1" Display="Dynamic" Enabled="false" />
<asp:DynamicValidator runat="server" ID="DynamicValidator1" CssClass="droplist" ControlToValidate="TextBox1" Display="Dynamic" />
<mkb:TimeSelector ID="StartTime"
Width ="120px"
SelectedTimeFormat="Twelve"
DisplaySeconds="false"
MinuteIncrement="5"
runat="server" >
</mkb:TimeSelector>
The Column is a dynamic field in ListDetails.aspx (as it came out of the VS2008 Project Template)
<asp:DynamicField DataField="StartTime" HeaderText="Start" />
In Edit mode clicking up and down on the Arrows to increment or decrement the time doesn't do anything.
I cannot change the time. Any ideas ?
Rgds
s
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: TimeSelector does not allow interaction in Edit Mode <mkb:TimeSlector (MichaelKBell)
Oct 14, 2009 10:35 AM|LINK
Hi Steve, where do I fing Michael's TimePicker and I'll have a go [:D] (I have my own time picker but I havent quite finished it [:$]) but post the link here and I'll set it up and see if I can make it work [:D]
Dynamic Data
Always seeking an elegant solution.
steve_mew
Member
8 Points
21 Posts
Re: TimeSelector does not allow interaction in Edit Mode <mkb:TimeSlector (MichaelKBell)
Oct 14, 2009 11:29 PM|LINK
Hi Steve,
The TimePicker I found on codeplex: http://timepicker.codeplex.com/
Author : http://www.michaelkbell.com/TimePicker/
I have it embedded in a custompage (~/DynamicData/CustomPages/{MyTableName}/ListDetails.aspx)
I really am a bit stumped.. There is some speculation it might be java namespace clash ? At any rate it's the best timepicker I have found so far and I would really like to see it work. Having said that if you have one in the mix i'd love to have a look at that too.
Oh and I must say I love your site, it's been extremely helpful to me. It is appreciated.
Rgds
Steve Mew
Microsoft Redmond Alumni - WinXP / SQL Server (#90903)
Here is what I have been messing around with :
<%@ Page Language="C#" MasterPageFile="~/Site.master" CodeBehind="TimeSheetListDetails.aspx.cs" Inherits="DynamicData01.TimeSheetListDetails" %>
<%@ Register src="~/DynamicData/Content/GridViewPager.ascx" tagname="GridViewPager" tagprefix="asp" %>
<%@ Register src="~/DynamicData/Content/FilterUserControl.ascx" tagname="DynamicFilter" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true" />
<!--<h2><%= GridDataSource.GetTable().DisplayName %></h2>-->
<asp:ScriptManagerProxy runat="server" ID="ScriptManagerProxy1" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true"
HeaderText="List of validation errors" />
<asp:DynamicValidator runat="server" ID="GridViewValidator" ControlToValidate="GridView1" Display="None" />
<asp:DynamicValidator runat="server" ID="DetailsViewValidator" ControlToValidate="DetailsView1" Display="None" />
<asp:FilterRepeater ID="FilterRepeater" runat="server">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("DisplayName") %>' AssociatedControlID="DynamicFilter$DropDownList1" />
<asp:DynamicFilter runat="server" ID="DynamicFilter" OnSelectedIndexChanged="OnFilterSelectedIndexChanged" />
</ItemTemplate>
<FooterTemplate><br /><br /></FooterTemplate>
</asp:FilterRepeater>
<asp:GridView ID="GridView1" runat="server" DataSourceID="GridDataSource"
AllowPaging="True" AllowSorting="True" OnDataBound="OnGridViewDataBound"
OnRowEditing="OnGridViewRowEditing" OnSelectedIndexChanging="OnGridViewSelectedIndexChanging"
OnRowDeleted="OnGridViewRowDeleted" OnRowUpdated="OnGridViewRowUpdated"
OnRowCreated="OnGridViewRowCreated" CssClass="gridview" AutoGenerateColumns="false">
<Columns>
<asp:CommandField ButtonType="Image"
CancelImageUrl="~/DynamicData/Images/icon-delete.gif"
EditImageUrl="~/DynamicData/Images/icon-edit.gif"
ShowEditButton="true"
UpdateImageUrl="~/DynamicData/Images/icon-save.gif" />
<asp:CommandField ButtonType="Image"
DeleteImageUrl="~/DynamicData/Images/icon-delete.gif"
ShowDeleteButton="true" />
<asp:DynamicField DataField="TimesheetId" Visible="false" />
<asp:DynamicField DataField="Date" />
<asp:DynamicField DataField="Unite_Employee" HeaderText="Name" UIHint="ForeignKey"/>
<asp:DynamicField DataField="Unite_Plant" HeaderText="Plant" UIHint="ForeignKey"/>
<asp:DynamicField DataField="Unite_ServiceOrder" HeaderText="Service #" UIHint="ForeignKey"/>
<asp:DynamicField DataField="Unite_Division" HeaderText="Division" UIHint="ForeignKey" />
<asp:DynamicField DataField="Unite_Allowance" HeaderText="Allowance" UIHint="ForeignKey"/>
<asp:DynamicField DataField="Unite_NonChargable" HeaderText="NonChargable" UIHint="ForeignKey"/>
<asp:DynamicField DataField="Unite_Location" HeaderText="Location" UIHint="ForeignKey"/>
<asp:DynamicField DataField="StartTime" HeaderText="Start" />
<asp:DynamicField DataField="LunchTime" HeaderText="LunchTaken" />
<asp:DynamicField DataField="FinishTime" HeaderText="Finish" />
<asp:DynamicField DataField="TotalHours" HeaderText="TotalHrs" />
</Columns>
<PagerStyle CssClass="footer" />
<SelectedRowStyle CssClass="selected" />
<PagerTemplate>
<asp:GridViewPager runat="server" />
</PagerTemplate>
<EmptyDataTemplate>
There are currently no items in this table.
</EmptyDataTemplate>
</asp:GridView>
<asp:LinqDataSource ID="GridDataSource" runat="server" EnableDelete="true" EnableUpdate="true">
<WhereParameters>
<asp:DynamicControlParameter ControlID="FilterRepeater" />
</WhereParameters>
</asp:LinqDataSource>
<asp:Panel ID="DetailsPanel" runat="server">
<br /><br />
<!--
<asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="DetailsDataSource"
AutoGenerateEditButton="true" AutoGenerateDeleteButton="true" AutoGenerateInsertButton="true"
OnModeChanging="OnDetailsViewModeChanging" OnPreRender="OnDetailsViewPreRender"
OnItemDeleted="OnDetailsViewItemDeleted" OnItemUpdated="OnDetailsViewItemUpdated" OnItemInserted="OnDetailsViewItemInserted">
</asp:DetailsView>
-->
<asp:LinqDataSource ID="DetailsDataSource" runat="server" EnableDelete="true" EnableInsert="true" EnableUpdate="true">
<WhereParameters>
<asp:DynamicControlParameter ControlID="GridView1" />
</WhereParameters>
</asp:LinqDataSource>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
public class DateMetadata
{
[UIHint("CalendarDateTime")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
public object Date;
[UIHint("TimePicker")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:t}")]
public object StartTime;
<%@ Control Language="C#" CodeBehind="TimePicker_Edit.ascx.cs" Inherits="DynamicData01.TimePicker_Edit" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="TimePicker" Namespace="MKB.TimePicker" TagPrefix="mkb"%>
<asp:ScriptManagerProxy runat="server" ID="ScriptManagerProxy1" />
<asp:TextBox Visible="false" Width="60px" ID="TextBox1" runat="server" CssClass="droplist" Text='<%# FieldValueEditString %>' Columns="20"></asp:TextBox>
<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" CssClass="droplist" ControlToValidate="TextBox1" Display="Dynamic" Enabled="false" />
<asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator1" CssClass="droplist" ControlToValidate="TextBox1" Display="Dynamic" Enabled="false" />
<asp:DynamicValidator runat="server" ID="DynamicValidator1" CssClass="droplist" ControlToValidate="TextBox1" Display="Dynamic" />
<mkb:TimeSelector ID="StartTime"
Width ="120px"
SelectedTimeFormat="Twelve"
DisplaySeconds="false"
MinuteIncrement="5"
runat="server" >
</mkb:TimeSelector>
steve_mew
Member
8 Points
21 Posts
Re: TimeSelector does not allow interaction in Edit Mode <mkb:TimeSlector (MichaelKBell)
Oct 15, 2009 05:16 AM|LINK
Well when I thought it couldn't get wierder it does....
Its not a true solution, more of a workaround but here are my findings,
Two experiments with only one change between them.....
Exp#1:
One instance of TimePicker control in the FieldTemplate ‘TimePicker_Edit.ascx’
– This results in the usual problem of unable to Edit, readonly, no way of editing in edit mode.
The Up/Down arrows do nothing (Events not firing or being received it seems - callback problem perhaps ?)
Exp#2:
One instance of the control in the parent page ‘ListDetails.aspx’ (not wired to anything at all, just the plain old control)
As before , one instance of TimePicker control in the FieldTemplate ‘TimePicker_Edit.ascx’
– This believe it or not Works !
What is that all about !? ;)
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: TimeSelector does not allow interaction in Edit Mode <mkb:TimeSlector (MichaelKBell)
Oct 15, 2009 02:49 PM|LINK
It could be that when it is used in the FieldTemplate that the javascript libraries are not being referenced correctly [:(] and puttin a copy on the relavent page but not using it is giving it the correct javascript refs.
Dynamic Data Custom Field Templates
Always seeking an elegant solution.
Mike Bell
Participant
1079 Points
219 Posts
Re: TimeSelector does not allow interaction in Edit Mode <mkb:TimeSlector (MichaelKBell)
Oct 27, 2009 09:49 PM|LINK
One think I'm not, is a tester! I'll put this sucker in a template tonight and take a gander and let you know what I coem up with...
My Code Blog
steve_mew
Member
8 Points
21 Posts
Re: TimeSelector does not allow interaction in Edit Mode <mkb:TimeSlector (MichaelKBell)
Oct 27, 2009 10:13 PM|LINK
Mike, That would be great. I suspect there somehow a visibility issue. A script is not being picked up.
Rgds
s
Mike Bell
Participant
1079 Points
219 Posts
Re: TimeSelector does not allow interaction in Edit Mode <mkb:TimeSlector (MichaelKBell)
Oct 28, 2009 02:55 PM|LINK
Steve, is yoru solution in a state that you could send it over?
My Code Blog
steve_mew
Member
8 Points
21 Posts
Re: TimeSelector does not allow interaction in Edit Mode <mkb:TimeSlector (MichaelKBell)
Oct 29, 2009 07:06 AM|LINK
Hi Mike,
Yes I can send it over..
whats a good email address ?
Rgds
s
steve_mew
Member
8 Points
21 Posts
Re: TimeSelector does not allow interaction in Edit Mode <mkb:TimeSlector (MichaelKBell)
Nov 05, 2009 10:23 PM|LINK
Sent !
Rgds
s