Welcome Guest Search | Active Topics | Sign In | Register

DatePicker VisibleDate Options
Loren Dorez
Posted: Wednesday, February 17, 2010 3:38:16 PM
Rank: Advanced Member
Groups: Member

Joined: 1/9/2009
Posts: 97
Hello

I appears that teh DatePickers Visible date is not load as today by default it get assigned the date the control was created.

Can this possible be update to make the visiable Default Date {var:Today}

If so awesome, until then how can i set all my DP Visible Date on a page to DateTime.now i tried

a Foreach based on the Type but its not working.
eo_support
Posted: Wednesday, February 17, 2010 4:30:38 PM
Rank: Administration
Groups: Administration

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

I am not sure what you mean by a "foreach based on the Type". You would just do something like this in your code:

DatePicker1.VisibleDate = DateTime.Today

Thanks!
Loren Dorez
Posted: Wednesday, February 17, 2010 4:36:07 PM
Rank: Advanced Member
Groups: Member

Joined: 1/9/2009
Posts: 97
Yes but there a specific page that has over 50+ DatePickers

I was trying to do something like this

foreach (Control oControl in Page.Controls)
{
If(oControl.GetType == ???)
{
(EO.Web.DatePicker)oControl.VisibleDate = DateTime.Today;
}
}
Loren Dorez
Posted: Wednesday, February 17, 2010 5:00:02 PM
Rank: Advanced Member
Groups: Member

Joined: 1/9/2009
Posts: 97
My suggesstion/request is maybe in a future build have the DEFAULT VALUE for Visible Date grab the current DateTime
eo_support
Posted: Wednesday, February 17, 2010 5:12:46 PM
Rank: Administration
Groups: Administration

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

I see what you mean. You definitely don't want to have 50+ DatePicker in one page. However go back to your original question ---- I believe VisibleDate is automatically set to the first day of the current month if you do not explicitly set it. It is set to the first day of the current month because the Calendar view goes by month.

Thanks!
Loren Dorez
Posted: Wednesday, February 17, 2010 6:01:53 PM
Rank: Advanced Member
Groups: Member

Joined: 1/9/2009
Posts: 97
It is set to the first Day of the Month of the DATE it was added to the Page. My issue is i built the Page back in Dec of 2009 and the visible date show 12/01/09 if i look at the HTML side of my code each DatePickers Visible Date is set to the Date i drag it onto the page. Is there a way you can have it set teh date to the first day in the current month when its initlialized or loaded? h,mmm just had an idea what if i dont set it in the markup (BTW it sets it by default in the markup)
eo_support
Posted: Wednesday, February 17, 2010 6:19:34 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Loren Dorez wrote:
BTW it sets it by default in the markup


That's the root of the issue. We could change it to not to set it when you initially put the DatePicker in your page however it will not change anything about your existing DatePickers. In your case you can simply delete VisibleDate from your .aspx/.ascx source so that it automatically picks up the current month.

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.