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

Display short date with working filters

4 Answers 52 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Minh
Top achievements
Rank 1
Minh asked on 03 Jul 2015, 03:48 PM

At the moment if you only want to display the date you set the column to be string and you set x.Date.ToShortDateString() and that works perfectly for showing short dates but the sort then breaks because the values are "strings"

 

for example it'll recognize 10/1/2015 > 1/2/2015 If the universal time setting on the machine is set to DD/MM/YYYY.

 

Are there ways to display short date string and retain the filters to work correct? 

4 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 06 Jul 2015, 07:51 AM
Hi,

You can apply a converter to the binding instead. Please keep in mind the filtering will be performed based on the property specified as DataMemberBinding. You can also refer to the documentation on Filtering.

Regards,
Dimitrina
Telerik
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
Minh
Top achievements
Rank 1
answered on 06 Jul 2015, 01:27 PM

Hi,

My grid at the moment is autogenerate columns, how would a converter be implemented if I don't specify the column? 

0
Dimitrina
Telerik team
answered on 06 Jul 2015, 01:38 PM
Hello,

You can subscribe for the AutoGeneratingColumn event and then work with e.Column.

Regards,
Dimitrina
Telerik
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
Minh
Top achievements
Rank 1
answered on 06 Jul 2015, 02:13 PM

Hi,

That sounds plausible, I tried the code from http://www.telerik.com/forums/codebehind-binding-with-converter-in-c but it seems like an old post. May I ask how do I set the DataMemberBinding.

Tags
GridView
Asked by
Minh
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Minh
Top achievements
Rank 1
Share this question
or