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

Filter DateTime Format

5 Answers 149 Views
GridView
This is a migrated thread and some comments may be shown as answers.
andrea nava
Top achievements
Rank 1
andrea nava asked on 25 Jun 2010, 10:09 AM
Hi,

I have two questions incident to Filter in a Gridview

1 I have a column bound to a Date Time property with a format like 'dd/mm/yyyy' . Applying a filter writing in the text area, the date that i have write is translated in a format like 'dd/mm/yyyy hh.mm.ss'. Can I avoid this translation?
2 Can I set the filter window' s height and weight? When i click the filter icon and the window filter is opened its height or weight is out of the allow area.

Thanks.

5 Answers, 1 is accepted

Sort by
0
andrea nava
Top achievements
Rank 1
answered on 28 Jun 2010, 05:22 PM
Hi,

Can I have an answer please? This is of primary importance for my project..

thanks..
0
Rossen Hristov
Telerik team
answered on 29 Jun 2010, 09:35 AM
Hello andrea nava,

This translation cannot be avoided, because the moment that you enter a string in the text-box it is parsed and converted to a DateTime object. After that the ToString representation of this DateTime object becomes the text of the TextBox. Unfortunately, .NET string formatting is a one way process and once a value was formatted, the reverse operation cannot be carried out, because it is indeterminate.

What you can do is create a your very own custom filtering control like described in this and this blog posts.

Here is an online example of a custom filtering control designed specifically for DateTime columns. Look at the "Founded" column. Its filter displays two RadDatePickers which are designed for handling DateTime values better than a simple TextBox.

You can take the custom filtering control from the example and use it for your project. You can extend it as well. This will also allow you to control the size of the filtering control, since it will be your own.

I hope this helps.

Greetings,
Ross
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
andrea nava
Top achievements
Rank 1
answered on 29 Jun 2010, 10:10 AM
Thanks for your help.

Last question: is there the substantial possibility that you implement a DateTime Column with its DateTime Filter in the next release?

thank you very mutch.

Andrea Nava
0
Rossen Hristov
Telerik team
answered on 29 Jun 2010, 10:30 AM
Hi andrea nava,

It will definitely not make it on time for the Q2 release, but we hope we will provide it for the Q3 one. Excuse us for the inconvenience.

Sincerely yours,
Ross
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
Rossen Hristov
Telerik team
answered on 14 Jul 2010, 01:36 PM
Hi andrea nava,

You can vote for this feature through its PITS Issue ID: 2664

Sincerely yours,
Ross
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
Tags
GridView
Asked by
andrea nava
Top achievements
Rank 1
Answers by
andrea nava
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or