DateTimePicker Control in WPF - wpf

I am searching for a DateTimePicker control which can be used as a textbox so user can enter date/time data at will (ie; type in the string "11/09/2008 12:30:00") or can select date/time from a drop down list that contains a calendar/time box (what i meant is that this control can provide both options as mentioned). If you have found such a flexible control (and free too) please give me the needed information to obtain it.

There's the DatePicker and Calendar controls from the WPF team, but I don't believe they handle times (as in your example) - just dates. Worth a look though.

Have a look at this WPF Date Picker question.
Cheers

Telerik has a decent DateTimePicker control but it's not free.

Old question, but for anyone interested... Extended WPF Toolkit™ Community Edition is free (also has a premium option) and contains a DateTimePicker which I have found to be very useful in WPF!

I am not sure whether you don't want to use JQuery or not aware of it. But here is this free/open source date time picker from JQuery which does exactly what you are looking for, plus lot more.

Related

DateTimePicker: Use neither calendar nor spin button

I want to take advantage of DateTimePicker's date validation, but the calendar seemed cumbersome to our customers for setting the date (they'd rather do it using just the keyboard, tabbing their way through the form).
So I took a long look at the documentation and found that one way to get rid of the calendar was setting the ShowUpDown property to true. So I got this:
However, our customers are now saying that they don't want to use the spin button, and therefore they don't want it to be visible/accesible. i.e. they want this:
However, if i set ShowUpDown to false, I'm back to the calendar. Is there another way?
Had to roll my own Custom Control. Luckily, some other guy from the team has already written custom controls so I have example code to get started. Anyway, what good is a framework if I have to do this kind of things myself? Hope they solved this in .net 4.5...
EDIT: Using a MaskedTextBox with ValidatingType = typeof(System.Date) is a better solution. Sorry .NET!

WPF Autocomplete using Combobox

I am trying to create an autocomplete textbox in WPF. What i found is http://weblogs.asp.net/okloeten/archive/2007/11/12/5088649.aspx. It seems quite close to what i needed. The only thing missing in this is when i press down arrow key after typing some characters it does not allow to me select an item from the narrowed list in dropdown.
Please give me some pointers how can i allow to select item using up/down keys after filtering list using some text input.
Regards.
There have been many implementations already for an autocompletebox. So as swiszcz stated, look for a working & well documented project. You need not spend time on trying to tweak some particular code for too long, when other options are available.
I have used an AutoCompleteBox implementation by Aviad P for many projects and found it easy enough to tweak and suite my needs. I feel the code is well documentated in the blog article itself. Also it uses a textbox & listbox (rather than a combobox) which is in my opinion, a better choice.

Blend Slider Control

Is there a free implementation of the text box in Blend's property grid that allows you to change the number by clicking and dragging? Or perhaps another way to ask is what kind of control called so I can google it?
just try this
http://www.codeproject.com/KB/WPF/MicrosoftBlendStyleTextBo.aspx
It's called a numeric UpDown control. (Terrible name, I know).
MS has a sample implementation for WPF, although I think you'll have to provide the draggable part yourself.

Are there any free currency textbox controls for Silverlight?

If not, what's the best way of sanitizing users' input (keyboard and pasting from the clipboard)?
DevExpress is releasing version 9.2 of their controls this week which includes a masked edit control based on RegEx:
http://community.devexpress.com/forums/p/78946/270208.aspx#270208
Aside from that you're stuck hacking KeyDown and TextChanged events to cobble something together. I've done a lot of that and I've got to say its not pretty and very hard to test! I'm not aware of a free control at the moment that does this.

Silverlight Date Formats

I'm getting some very strange date formatting issues in my Silverlight application. My local culture is set to UK, yet I am consistently seeing US dates popping up all over the place. I can easily hardcode these to UK format in specific loactions using:
<UserControl ... Language="en-GB"...>
But as I'm sure you'd all agree this is a terrible thing to do.
I have tried setting the Lanaguage to en-GB in the main application and this has partial success. I have also tried Justin Angels suggestion (posted here: How to change date format in Silverlight DatePicker control?), again only partial success.
An example of the issue can be seen here:
http://lh3.ggpht.com/%5FL9TmtwXFtew/Sw5aVZJfG1I/AAAAAAAAGkI/6jYnsB91HjI/image%5Fthumb%5B1%5D.png http://lh3.ggpht.com/%5FL9TmtwXFtew/Sw5aVZJfG1I/AAAAAAAAGkI/6jYnsB91HjI/image%5Fthumb%5B1%5D.png
The datagrid on the parent page shows UK formatting, whilst the information in the ChildWindow shows US formatting ...grrrr
Anyone have a definitive solution for solving this across a whole application?
Thanks,
Mark
You can data bind Language property of the root visual element. Take a look at my question here:
How to switch UI Culture of data binding on the fly in Silverlight
Can you not use the SelectedDateFormat property of the datepicker? If you want to do this once could you not create your own usercontrol that derives from the original with this value preset, then use your derived control throughout your app?
Kindness,
Dan
Shot in the dark, but does changing the browser's Language Preference make a differnence? I.e. in IE Tools-->Internet Options-->Languages.
HTH
Mark
You can set the date format for your entire application in the application start up event as follows.This will override any regional settings on the users machine
Thread.CurrentThread.CurrentCulture = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();
Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = dd/MM/yyyy";

Resources