Welcome Guest Search | Active Topics | Sign In | Register

DatePicker Control Binding Options
handii
Posted: Wednesday, May 14, 2008 7:10:57 AM
Rank: Newbie
Groups: Member

Joined: 5/5/2008
Posts: 9
I am using DatePicker within EditItemTemplate of the DataList control. I
need to bind datepicker to datetime from database. DataBinding is done
programatically. How can I do that. I have tried VisibleDate='<% Eval("DOB")
%>'. That didnt work. Please help
eo_support
Posted: Wednesday, May 14, 2008 7:18:08 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,090
Hi,

Try to run the page and see if you get any error message. If you do, post the error message and that should help us to point you to the right direction.

If you do not get any error message, try to place an asp:Label next to the DatePicker and bind the same expression to its Label property and see what you get.

Thanks
handii
Posted: Wednesday, May 14, 2008 3:01:02 PM
Rank: Newbie
Groups: Member

Joined: 5/5/2008
Posts: 9
No error. Label works fine. Here is a code

<eo:DatePicker ID="dpDateOfBirth" runat="server" ControlSkinID="None"
DayCellHeight="15" DayCellWidth="31" DayHeaderFormat="Short" DisabledDates=""
OtherMonthDayVisible="True" PickerFormat="dd/MM/yyyy" SelectedDates=""
TitleFormat="MMMM, yyyy" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
TitleRightArrowImageUrl="DefaultSubMenuIcon" VisibleDate='<%# Eval("DOB") %>' >
<TodayStyle CssText="font-family:Verdana;font-size:8pt;background-image:url('00040401');color:#1176db;" />
<SelectedDayStyle CssText="font-family:Verdana;font-size:8pt;background-image:url('00040403');color:Brown;" />
<DisabledDayStyle CssText="font-family:Verdana;font-size:8pt;color: gray" />
<FooterTemplate>
<table border="0" cellpadding="0" cellspacing="5"
style="font-size: 11px; font-family: Verdana">
<tr>
<td width="30">
</td>
<td valign="center">
<img src="{img:00040401}"></img></td>
<td valign="center">
Today: {var:today:dd/MM/yyyy}
</td>
</tr>
</table>
</FooterTemplate>
<CalendarStyle CssText="background-color:white;border-bottom-color:Silver;border-bottom-style:solid;border-bottom-width:1px;border-left-color:Silver;border-left-style:solid;border-left-width:1px;border-right-color:Silver;border-right-style:solid;border-right-width:1px;border-top-color:Silver;border-top-style:solid;border-top-width:1px;color:#2C0B1E;padding-bottom:5px;padding-left:5px;padding-right:5px;padding-top:5px;" />
<TitleArrowStyle CssText="cursor: hand" />
<DayHoverStyle CssText="font-family:Verdana;font-size:8pt;background-image:url('00040402');color:#1c7cdc;" />
<MonthStyle CssText="cursor:hand;margin-bottom:0px;margin-left:4px;margin-right:4px;margin-top:0px;" />
<TitleStyle CssText="font-family:Verdana;font-size:8.75pt;padding-bottom:5px;padding-left:5px;padding-right:5px;padding-top:5px;" />
<DayHeaderStyle CssText="font-family:Verdana;font-size:8pt;border-bottom: #f5f5f5 1px solid" />
<DayStyle CssText="font-family:Verdana;font-size:8pt;" />
</eo:DatePicker>
eo_support
Posted: Wednesday, May 14, 2008 3:11:50 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,090
Your code looks fine. Do you happen to confuse VisibleDate with SelectedDate? VisibleDate determines the first month when you open the drop down, where as SelectedDate is what appears inside the textbox.
handii
Posted: Wednesday, May 14, 2008 7:13:01 PM
Rank: Newbie
Groups: Member

Joined: 5/5/2008
Posts: 9
Got it working now. I kmew it was supposed to be SelectedDate, but this property didn't come up in intellisense, only SelectedDates came up. That is why I tried to use VisibleDate. But now I have put SelectedDate property manualy in the code and it worked. Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.