I'm pretty new to XAML/C# and have a view that contains two textboxes. When the user clicks on the textbox, I want it to open up a basic calendar with either today's date or the date of the textbox. Once the date has been clicked, I want it to return that value.
I was going to create a new XAML view with a calendar control and then work it with variables, but before I did that I wanted to know if there is a better / more technically correct way.
Thank you.
If you are developing WPF application then just use DatePicker control and if you want to get time also then install Extended WPF Toolkit in that use the DateTimePicker Control...
Developing for Windows Phone or WinRT (Windows Store) apps use DatePicker Control.
Related
I am working on Windows 10 App and in my app, I get languages from the server and user can select any language from that. Now if the user selects Arabic, it works in RighttoLeft so I want to change it for all UI controls. Can someone suggest the easiest way to do that?
I am aware that we can use FlowDirection attribute for it. But there are many controls in my app and for each and every control, it will be difficult to change FlowDirection.
I am currently working on WP8 and my requirement is to create a item which allows user to select both Date and Time and the details are combined and added in TextBox.
Can anyone suggest is there any third party control using which I can add this control or I should just create Custom Control ?
I am aware of creating custom control but it becomes difficult when managing data.
I am developing an attendance system where the functioning of the system depends on date. For instance, if it is local holiday or sunday, the control of system like Create Leave features is to be disabled. Also, the calender must show red on holidays. Is there any control in asp.net that helps me do this efficiently.how to create custom calender and add event on that calender and make system function according to calender!!!
Asp.Net has a calendar control. Play with it.
According to this post, there's a separate DatePicker control in .net 4. I've tried it, and I don't see a good way to also let it select the time of the day.
Is there an easy way to transform DatePicker into DateTimePicker by editing XAML template? If not, what is the best way to get a DateTimePicker for WPF 4.0?
Extended WPF Toolkit sports a nice DateTimePicker with time of day.
There is also an article over on CP where someone created a control that works like the Winforms one... A WPF DateTimePicker That Works Like the One in Winforms
There isn't one without making it yourself or using a 3rd party control. However there is one within winforms if you want a quick fix that doesn't support data binding...
xmlns:window="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
<window:WindowsFormsHost >
<wf:DateTimePicker Format="Time" ></wf:DateTimePicker>
</window:WindowsFormsHost>
Just a time picker, but could easily be paired with a datepicker. You also need a reference to WindowsFormsIntegration and System.Windows.Forms.
Try the DateTimePicker in the extended WPF toolkit.
If you do want an DateTimePicker without external controls and also for commercial use, I've improved an existing one and share it here:
https://gist.github.com/Apflkuacha/406e755c8b42a70b7ab138e6b985bcdf
It will look like this, a field which shows the selected date&time and a popup window to select the date and time:
Are there newer, and better DateTimePicker out there that can resemble more of Window's default DateTimePicker for WPF C#?
Yes, I know this is not a new question.
There are WPF Toolkits and SO. But these are fairly dated (latest update I found were from the 09) and I am not able to find any newer sources. There is this Avalon Library but, no offense, it's buggy, ugly and difficult to implement (for me perhaps), also difficult to click the textboxes etc.
Are there newer, open source or commercial DateTimePicker? Do people host their DateTimePicker Form Control in WPF?
Note that what you are showing is most likely not a single control but a combination of controls. In there I see a month calendar control, a time picker and a custom control showing an analogic clock.
bout WPF controls there are tons of libraries and suites out there with anything you need including datetime and time pickers, for example Telerik, Infragistic, DevExpress etc...
The clock in the image is not part of the time control. It is just a clock.
You could have a look at the commercial controls of Telerik