By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,650 Members | 1,785 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,650 IT Pros & Developers. It's quick & easy.

Position of Calendar in DatePicker

P: 3
Hi, I have trouble setting the position of the DatePicker, a control from WPF Toolket June 2009 release.

When click on the DatePicker control, the Calendar always open as a drop down and expands to the right, but the Calendar goes out of bound as the DatePicker control is aligned to the Right of the screen.

Since I cannot change the location or alignment of the DatePicker, I would like the Calendar opens up as a drop down but expands to the Left of the screen, without changing the flowDirection. Is this possible? If so, please help and explain how. Thanks!
Attached Images
File Type: jpg datePickerCalendar.jpg (7.1 KB, 810 views)
Jan 6 '10 #1
Share this Question
Share on Google+
6 Replies


tlhintoq
Expert 2.5K+
P: 3,525
What am I failing to understand?
You were able to take a screen shot of it, so it appears to NOT be off the screen or out of bounds. It doesn't look chopped in any way.
Jan 6 '10 #2

P: 3
Hi tlhintoq,

The image is an prototype that I'm building on Windows, which will be ported to an embedded device where the calendar will be cropped once it goes out of bound. Sorry for the confusion.
Jan 6 '10 #3

Frinavale
Expert Mod 5K+
P: 9,731
Instead of placing the prompts beside the DateTime pickers consider placing them on top of them.

Or you could consider making the DateTime pickers shorter (since it looks like you're wasting a lot of space with them stretched out across the page).


Are you sure that the DateTime picker pop up doesn't just go to the edge of the screen (are you sure it get's cut off in the device?)

-Frinny
Jan 6 '10 #4

P: 3
Hi Frinny,

Thanks for your response.

I don't understand your first advice on "placing them on top". Can you please explain it?

I can make the DateTime picker shorter, but it doesn't uniform with other fields that has been blocked. I can do is to shrink the size once it is in focus, but it is an undesired behavior.

I am not sure about the device because we have not get to the stage yet. I did try moving my app to the right side of my screen, and it just go to the end of the screen. Maybe I don't need to do a thing once we load it to the device

Despite my findings above, I would still like to know if I can do one of the following to be certain of the app behavior:

1. Reverse the order of the texbox and the calendar mini-button, which should move the calendar drop down to start from the beginning of the control, or
2. Make the calender to expand to the right, without change the flowdirection.

Thanks again!
Jan 6 '10 #5

Frinavale
Expert Mod 5K+
P: 9,731
You're actually probably more knowledgeable than I am in WPF. I've only been playing with it for a week or so. Do you have something like Expressions Blend to help you figure this stuff out? (Please note that you need more than 1 gig of RAM to run this application or else bad things happen...I know from experience)

What I was recommending is:
Expand|Select|Wrap|Line Numbers
  1. Prompt for DateTimePicker
  2. <date time picker>
  3.  

I'm going to try experimenting with this too to see if I can help you.

-Frinny
Jan 6 '10 #6

tlhintoq
Expert 2.5K+
P: 3,525
The image is an prototype that I'm building on Windows, which will be ported to an embedded device where the calendar will be cropped once it goes out of bound. Sorry for the confusion.
So you aren't really sure that it is going to be cut off.
I think you will find that the calendar control, like most menus, will automatically reposition itself if it trys to open outside the bounds of the screen.
I suggest you try making your form/window fullscreen as a test, then open the calendar actually off the edge of the screen and CONFIRM that if it actually cuts off or not.
Jan 6 '10 #7

Post your reply

Sign in to post your reply or Sign up for a free account.