Selecting WorkWeek w/ attached DatePicker |
Post Reply |
Author | |
dajv
Groupie Joined: 27 July 2004 Location: Australia Status: Offline Points: 80 |
Post Options
Thanks(0)
Posted: 06 December 2005 at 11:26pm |
I have attempted to write some code so that when the calendar attached to a datepicker is set to WorkWeek view, a single date selected the datepicker will select the (nearest) work week.
Since it is attached though (and this is a requirement), the calendar view changes to dayview when a single day is selected when a single day is selected on the DatePicker. Any code that tries to make it select the workweek is therefore obviously going to be of the "dodgy" nature. I would think that since the DatePicker is attached to the calendar it can recognise that it has the view set to WorkWeek and could alter the selection appropriately. Can this be added in the next version? I wouldn't expect it to be a lot of work and its a pretty important thing to implement, since there is no way of doing it in code yet Outlook has this functionality. Alternatively, I suppose you could provide an event for the DatePicker that would be like a _PreSelect event that would let you alter a selection before it gets sent to the Calendar. This would be a bit dodgy though. The first method would be best, for sure. Theres no reason it can't be smart enough to do that for work week view (as an option, of course). Thanks. |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi,
Thanks for a review and the suggestion. Will fix this issue for the next release. -- WBR, Serge |
|
dajv
Groupie Joined: 27 July 2004 Location: Australia Status: Offline Points: 80 |
Post Options
Thanks(0)
|
That would be great, thanks.
|
|
dajv
Groupie Joined: 27 July 2004 Location: Australia Status: Offline Points: 80 |
Post Options
Thanks(0)
|
This doesn't seem to be fixed in 9.81... is there something I need to do to implement this?
|
|
gshawn
Senior Member Joined: 04 October 2004 Status: Offline Points: 227 |
Post Options
Thanks(0)
|
I think he meant it will be fixed in the next version after 9.81... He posted this after v9.81 was released. |
|
dajv
Groupie Joined: 27 July 2004 Location: Australia Status: Offline Points: 80 |
Post Options
Thanks(0)
|
I have tried again to implement this without success. It is impossible as far as I can gather. Please implement this very simple request in the DatePicker.
|
|
dajv
Groupie Joined: 27 July 2004 Location: Australia Status: Offline Points: 80 |
Post Options
Thanks(0)
|
Ah i see. I didn't realise it was released first of this month.
|
|
jeffrowberg
Newbie Joined: 30 December 2005 Location: United States Status: Offline Points: 1 |
Post Options
Thanks(0)
|
I have come up with a cheap way to obtain this functionality by using a MonthView object (contained in standard MS common controls someplace, I don't remember which version). If you are on a five-day view, clicking on a weekend will result in the five nearest work days being selected. On a seven-day view, it just does what you would expect. My code below also checks whether a single day was selected, so if you select multiple days on purpose, it doesn't reset your selection. This would be easy to remove though.
I know using a MonthView object is inefficient, but it makes it easy to get the DayOfWeek value from the date. For reference, "mViewType" is the view type (0 for 5-day, 1 for 7-day), and "DPick" is the date picker (duh). Jeff
|
|
dajv
Groupie Joined: 27 July 2004 Location: Australia Status: Offline Points: 80 |
Post Options
Thanks(0)
|
Thanks jeffrowberg, but determining the dates that should be selected was the least of my problems. The real issue is that you have to "adjust" the selection on the date picker after the fact, and the way I use the datepicker and calendar thats not feasible.
Thanks though. |
|
dajv
Groupie Joined: 27 July 2004 Location: Australia Status: Offline Points: 80 |
Post Options
Thanks(0)
|
Serge,
Is this present in 10.1? I can't see that it is. Thanks.
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Check out version 10.1.1 -- if you switch to WorkWeek mode there, it will be kept so when you select a single day.
-- WBR, Serge |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions 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 |