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

Grid filtering with dd/MMM/yy format

3 Answers 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Keith
Top achievements
Rank 1
Keith asked on 01 Apr 2010, 07:26 PM
We have been using grid column filtering with the RadGrid control for some time. We have been requested to change the date format throughout the application to  dd/MMM/yy

Setting the DataFormatString="{0:d}" (shown below) breaks the filtering with version 2009.3.1208.35. No filtering occurs. When a date with this format is entered and "Equal To" is selected for the filter, the results are an empty grid. The system date format has been set to "dd MMM yy".



<telerik:GridBoundColumn UniqueName="DateAdded" DataField="DateAdded" SortExpression="DateAdded"
                                HeaderText="Created" DataFormatString="{0:d}" Groupable="false"
                                ItemStyle-HorizontalAlign="Right" FilterControlWidth="65px">
                                <HeaderStyle Width="85px" />
                            </telerik:GridBoundColumn>

How do we get the grid filters to work with this date format?

Thanks in advance,

Keith E.

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 07 Apr 2010, 06:41 AM
Hello Keith,

Basically, in such a case it is expected for the control to return no data. The reason for this is that the date is in a format different from the one in the underlying database, and thus when the values are compared, they do not match. To see more information on a possible way to address this, please refer to the following article:

http://www.telerik.com/help/aspnet-ajax/grdfilteringfordatetimecolumnwithdataformatstring.html

I hope this helps.

Regards,
Yavor
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
Jeremy Lutz
Top achievements
Rank 1
answered on 12 Apr 2010, 03:58 PM
Keith and I have implemented this solution but can't get it to work.

Our culture setting is dd MMM yy. Implemented the code as stated in the article. When a user enters a date it converts it to the proper visible format that we want which is dd MMM yy.

We implemented the custom filtering example according to the example shown but it isn't working.

We get the data from the database and populate a dataset. The dataset displays the data according to our culture format of dd MMM yy. There is also a "0000 GMT" at the end of the associated date. The database format is "mm/dd/yyyy 12:00:00 AM". We are thinking that it isn't working because the culture changes the dataset date values to the format we want ( dd MMM yy ) . This dataset is used to bind the data to the grid.

The example says to use the mm/dd/yyyy format. So we changed the filter expression to this date format which is the same format as in our database. Not sure what we need to do. Please help.


0
Yavor
Telerik team
answered on 14 Apr 2010, 03:07 PM
Hi Jeremy,

If the sample is not working as per your requirements, you can open a formal support ticket, and send us a small working project, demonstrating your setup, and showing the unwanted behavior. We will review it locally, and advise you further.

Greetings,
Yavor
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
Grid
Asked by
Keith
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Jeremy Lutz
Top achievements
Rank 1
Share this question
or