Introduction
Date Picker is a control available in WPF Toolkit. In this article we would see how we can use DatePicker in DataGrid in WPF.
Crating WPF Application Project
Fire up Visual Studio 2008 and Create a WPF Application and name the project as DatePickerDGWPF.
Here is the basic idea of our sample application; we will have sample data with one or more datetime properties, which will be displayed in DataGrid.
When the DateTime cell will be in edit mode we will display the DatePicker in the cell instead of TextBox, which is by default.
So let's have a class and have sample data.
Now we will add a DataGrid to the Window and design the Columns inside of it.
It seems we are done with the design of our DataGrid columns.
Run the application and try to edit the column "Raised On", you would get DatePicker control to handle the Date and Time.

Hope this article helps.
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

Ali HamzaPosted Mar 24, 2018, 12:46 AM
Please tell me about this problem.
Ali HamzaPosted Mar 24, 2018, 12:45 AM
It is very helpfull. But i want to capture selected date change and update database.
Tawfek MokhtarPosted Jul 1, 2013, 9:08 AM
Hi, thanks for this nice article. I have used your code for my program. Basically there are two date pickers, 1 to show start date and another one to show end date for a task. There will be 1 column called Duration that will show how many days between these 2 dates. I cannot make the Duration column to show any changes when any of the datepicker changes. Please help me how to do this ?
Yuri BondarenkoPosted May 30, 2012, 3:22 AM
Here is nice example of DateTimePicker in DataGrid: http://www.codearsenal.net/2012/03/wpf-datetimepicker-in-datagrid.html
TAN WhoAMIPosted Apr 10, 2012, 2:25 AM
I understand your idea is to demonstrate the DateTimePicker in DataGridView. how about my posting here? http://www.codeproject.com/Questions/363201/DateTimePicker-in-DataGridView
Yuri BondarenkoeditedPosted Mar 15, 2012, 8:39 AMEdited Mar 15, 2012, 8:40 AM
Another good topic on DateTimePicker in WPF datagrid: http://clear-code.blogspot.com/2012/03/wpf-datetimepicker-in-datagrid.html