Dynamic Data and TimePicker. Picker Locks up

Oct 14, 2009 at 11:38 PM

Hi All,

Love the timepicker but can't get it to work within a .Net 3.5 SP1 Dynamic Data Web Site Context. It appears but Edit functionality is locked. I am unable to change the time.

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.


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>