This is a migrated thread and some comments may be shown as answers.

cannot implement DisplayValueFormat in DataGridDateColumns

2 Answers 10 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 03 Oct 2016, 09:42 PM

I am having a hard time figuring things out in formatting the date.

Basically I expect that I can use the DisplayValueFormat of RadGridDatePicker in DataGridDateColumns. As what they said here: The DataGridDateColumns is used to represent DateTime objects. It uses the RadDatePicker control to pick a value in EditMode http://docs.telerik.com/windows-universal/controls/raddatagrid/columns/datagrid-datecolumn.

 

http://docs.telerik.com/windows-universal/controls/raddatepicker-and-radtimepicker/properties-and-configuration/raddatetimepickers-properties-pickerproperties

2 Answers, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 04 Oct 2016, 06:01 PM
Hello Joshua,

The DataGrid's columns have a property named CellContentFormat that lets you apply a string format.

You didn't specific which format you wanted, so I used the DateTime string format "d" in this example:

<grid:DataGridDateColumn PropertyName="GraduationDate" CellContentFormat="{}{0:d}">


Here is a screenshot of the result and I've also attached a runnable demo that you can use to see the approach in action.

Please let us know if you have any further questions. Thank you for contacting Support and for choosing Telerik by Progress.

Regards,
Lance | Tech Support Engineer, Sr.
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Joshua
Top achievements
Rank 1
answered on 12 Oct 2016, 07:11 PM
it worked. thanks!
Tags
DataGrid
Asked by
Joshua
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Joshua
Top achievements
Rank 1
Share this question
or