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

Date format / Date filtering on GridViewDataColumn?

3 Answers 254 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 18 Oct 2010, 04:03 PM
Part 1: Date format in GridViewDataColumn:
I have a need to display a DateTime in a column with the following format: "MMM dd yyyy h:mm:ss tt". How would I go about doing that? Using the DataFormatString dependency property seemed like the logical choice, but did nothing.


Part 2: How do I filter by date?
On the Telerik webpage under the heading "Filtering and Excel-like Filtering", there is a date time filter. How do I enable that for a GridViewDataColumn that has a DateTime as a backing property type? I've tried all sorts of things, and this is what I'm currently using, but it does nothing - I only am able to use the standard string filter.

<t:GridViewDataColumn DataMemberBinding="{Binding LastSave, Mode=OneWay}" DataType="{x:Type System:DateTime}" Header="Last Save" IsReadOnly="True" IsGroupable="False" />


Part 3: How do I show empty cells for DateTime.Min values?
I also have the need to show an empty cell if the backing value is DateTime.Min. How would I accomplish that?

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 20 Oct 2010, 01:55 PM
Hi Robert,

I have already replied to your support ticket:

Straight to your questions:

1. I was not able to reproduce the problem in our latest release (Q3 2010 Beta). Please check the attached project for a reference.

2. You can check the Custom Filter Controls demo - the Founded column uses just that (this is the Silverlight demo, but the WPF code should be the same)

3. You should use the CellTemplateSelector property of the column. It is included in the attached project as well.

Hope this helps.


The project can be downloaded from here.

Best wishes,
Veselin Vasilev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Rodney Foley
Top achievements
Rank 1
answered on 27 Mar 2012, 07:52 PM
Can you repost the project that was attached in response to this thread, it is no longer available.
0
Iva
Telerik team
answered on 28 Mar 2012, 11:53 AM
Hello Rodney,

 You can find the project here.  We are sorry for the caused inconvenience!

Greetings,
Iva
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
GridView
Asked by
Robert
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Rodney Foley
Top achievements
Rank 1
Iva
Telerik team
Share this question
or