|
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.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,201
|
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!
|
|
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; } }
|
|
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
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,201
|
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!
|
|
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)
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,201
|
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!
|
|