DatePicker In DataGrid In WPF


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. J

Related Posts:

1) Making Timeline Control for DataGrid In WPF

2) Custom Gridline Color of Datagrid In WPF

3) Custom Row and Header Height of Datagrid In WPF

4) Rounded Corner Datagrid In WPF

5) Tooltip In DataGrid In WPF

6) Grouping In Datagrid In WPF

7) Cell Alignment In DataGrid In WPF

8) Edit Row Details In Context Menu In DataGrid In WPF

9) Hide/Un-Hide Columns Using Context Menu In DataGrid In WPF

10) Hide &Un-Hide DataGrid Column(s) In WPF

11) ComboBox In DataGrid In WPF

12) CRUD Operation In DataGrid In WPF