Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 24, 2012 04:06 AM by Decker Dong - MSFT
Member
9 Points
55 Posts
Dec 23, 2012 08:43 AM|LINK
i have down loaded asp time picker from internet. now i want to add it to one of my detailview cell but it gives error of "Specified cast is not valid".
here is the code of my item template of 'StartDate'.
<asp:TemplateField HeaderText="StartTime" SortExpression="StartTime"> <EditItemTemplate> <MKB:TimeSelector ID="TimeSelector1" runat="server" AmPm="PM" BorderColor="Silver" Date="" Enabled='<%# Eval("StartTime") %>' Hour="0" Minute="0" Second="0" SelectedTimeFormat="Twelve"> </MKB:TimeSelector> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("StartTime") %>'></asp:TextBox> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label3" runat="server" Text='<%# Eval("StartTime") %>'></asp:Label> </ItemTemplate> </asp:TemplateField>
i don't understand what to do so that this time picker work.
All-Star
31247 Points
6384 Posts
Dec 23, 2012 08:59 AM|LINK
Enabled='<%# Eval("StartTime") %>' //wrong property
You have wrong bound the property, try bind selectedtime
SelectedTime='<%# Bind("StartTime") %>'
I am not sure about the property, you can see the documentation
Dec 23, 2012 09:12 AM|LINK
the time picker does not has any selectedtime property .
then what should i do?
118619 Points
18779 Posts
Dec 24, 2012 12:27 AM|LINK
Adnan dani MKB:TimeSelector ID
What's that control? I cannot reproduce your issue here.
But instead, I'd like to suggest you using Microsoft's AJAX Calendar control:
<asp:FormView runat="server" ID="formView1" DefaultMode="Insert"> <InsertItemTemplate> <asp:TextBox ID="TextBox1" runat="server" /> <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1" /> </InsertItemTemplate> </asp:FormView>
Dec 24, 2012 01:29 AM|LINK
dear sir,
i have used the calendar control for selecting the date. now i want to use a control from which i can select and edit the time only not the date.
if you can suggest any such control which can help me in selecting the time.
Dec 24, 2012 04:06 AM|LINK
Hello again,
Maybe you can use the free jQuery Time Selector:
http://www.jquery4u.com/plugins/10-jquery-time-picker-plugins/
Adnan dani
Member
9 Points
55 Posts
Time Picker in Detailview
Dec 23, 2012 08:43 AM|LINK
i have down loaded asp time picker from internet. now i want to add it to one of my detailview cell but it gives error of "Specified cast is not valid".
here is the code of my item template of 'StartDate'.
<asp:TemplateField HeaderText="StartTime" SortExpression="StartTime"> <EditItemTemplate> <MKB:TimeSelector ID="TimeSelector1" runat="server" AmPm="PM" BorderColor="Silver" Date="" Enabled='<%# Eval("StartTime") %>' Hour="0" Minute="0" Second="0" SelectedTimeFormat="Twelve"> </MKB:TimeSelector> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("StartTime") %>'></asp:TextBox> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label3" runat="server" Text='<%# Eval("StartTime") %>'></asp:Label> </ItemTemplate> </asp:TemplateField>i don't understand what to do so that this time picker work.
oned_gk
All-Star
31247 Points
6384 Posts
Re: Time Picker in Detailview
Dec 23, 2012 08:59 AM|LINK
Enabled='<%# Eval("StartTime") %>' //wrong propertyYou have wrong bound the property, try bind selectedtime
SelectedTime='<%# Bind("StartTime") %>'I am not sure about the property, you can see the documentation
Adnan dani
Member
9 Points
55 Posts
Re: Time Picker in Detailview
Dec 23, 2012 09:12 AM|LINK
the time picker does not has any selectedtime property .
then what should i do?
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Time Picker in Detailview
Dec 24, 2012 12:27 AM|LINK
What's that control? I cannot reproduce your issue here.
But instead, I'd like to suggest you using Microsoft's AJAX Calendar control:
<asp:FormView runat="server" ID="formView1" DefaultMode="Insert"> <InsertItemTemplate> <asp:TextBox ID="TextBox1" runat="server" /> <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1" /> </InsertItemTemplate> </asp:FormView>Adnan dani
Member
9 Points
55 Posts
Re: Time Picker in Detailview
Dec 24, 2012 01:29 AM|LINK
dear sir,
i have used the calendar control for selecting the date. now i want to use a control from which i can select and edit the time only not the date.
if you can suggest any such control which can help me in selecting the time.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Time Picker in Detailview
Dec 24, 2012 04:06 AM|LINK
Hello again,
Maybe you can use the free jQuery Time Selector:
http://www.jquery4u.com/plugins/10-jquery-time-picker-plugins/