DatePicker In DataGrid In WPF

No.of Views1528
Bookmarked0 times
Downloads 
Votes0
By  dpatra   On  26 Apr 2010 09:04:26
Tag : WPF , DateTime Controls
Date Picker is a control available in WPF Toolkit. In this article we would see how we can use DatePicker in DataGrid in WPF.
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

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.

Creating WPF Application Project


Fire up Visual Studio 2008 and Create a WPF Application and name the project as DatePickerDGWPF. 

Image Loading

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.
 

Image Loading

Now we will add a DataGrid to the Window and design the Columns inside of it.
 

Image Loading

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.
 

Image Loading

 

Image Loading

 

Conclusion

In this article, i have given way for create datetime picker in WPF.Hope this article helps.

Sample Project Source

Download source files -525 kb

 
Sign Up to vote for this article
 
About Author
 
dpatra
Occupation-Not Provided
Company-Not Provided
Member Type-Expert
Location-Not Provided
Joined date-13 Jul 2009
Home Page-Not Provided
Blog Page-Not Provided
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top