DateTimePicker for WPF 4.0 - c#

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:

Related

Display data in a table in Universal App

I have been looking for a couple of days for a UWP control that has similar functionality as the WPF ListView, which allows me to create a table like appearance.
Is there a control like this in the UWP or not?
What I want to achieve is a SCRUM and Kanban overview for Jira Software. Maybe there are better options.
Microsoft has created an add-on control that fits this use case nicely, the DataGrid control from their community toolkit.
More details: https://learn.microsoft.com/en-us/windows/communitytoolkit/controls/datagrid
It supports sorting, filtering, grouping, and can even generate columns automatically from supplied data.
There is a control such as that and it is called listview.
https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.listview.aspx
Maybe you could use GridView as well, there is a nice short tutorial on:
https://channel9.msdn.com/Series/Windows-10-development-for-absolute-beginners/UWP-040-Data-Binding-to-the-GridView-and-ListView-Controls

Best way to add a calendar to a textbox

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.

Can I reliably consume a WPF custom control in a winform?

My requirement is to create a winform with contains a datagrid that allows rows to expand and show additional details. I'm considering using a WPF control and incorporate a WPF Datagrid in it to handle this, taking advantage of the RowDetails property of the DataGrid to handle the expansion of rows.
I'm completely new to WPF and the RowDetails property of Datagrid and so am only reading up on them now. Is it possible for me to use this control in my winform once I develop it? What issues may I face when trying to integrate the WPF control in my winform.
I have on multiple occasions used a WPF control on a WinForm. However, the only way I ever do it is to host it inside an ElementHost control. Once there I haven't noticed any major issues, though I do hear performance can be suspect depending on the usage.
As the two previous Answers state you have to use an ElementHost.
Here there is a comparison on how to host WPF in Winforms and Winforms in WPF. It was good for me to read the comparison when I was starting to work with it.
In this article the author links you to Gotchas For Working With Windows Forms/WPF Interop that has some common issues you can run into.
Build your WPF control like it was a Vendor control, with a clear interface and then just host it with the ElementHost. I have had to use it both ways but with legacy controls, and it really helps if you have a good interface in the control that you bring from the other platform, if not it can be a bit messy.

AppBar icons in the Toolkit's DateTimePicker

I am building my application in the Windows Phone 8 framework. I am facing the critical problem here. Initially i developed my app using the Telerik's DateTime picker but unfortunately it had some animation and looping problem so i taken the DatePicker from the ToolKit and created the custom control with this. Unfortunately i am not able to access the AppBar of the DatePicker to update it based on my requirements. Is there any option to access the Application bar of the DatePicker in the Toolkit ?. Help can be appreciated.
I had a similar problem and
this worked out great for me.

New DateTimePicker for WPF?

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

Categories

Resources