We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Filtering on DateTime Column does not work

I have a grid attached to a sqldatasource which is reading from a table in which one of the columns is a datetime column.It is a sql server table. The grid has filter set for all columns.
The grid's filter mechanism works on all the columns except the column which is type datetime. Even after using the Convert statement in the select query of the sqldatasource to convert the column to a Varchar type, the filter in the grid still doesnt work for this column.

Can anyone help me out with this issue?

13 Replies

AD Administrator Syncfusion Team January 5, 2007 02:28 AM UTC

Hi Jahmai,

We couldn't able to reproduce the issue as you mentioned. So we have created one sample which will bind the Grid to SqlDatasource/AccessDatasource with FilterOption. Unlike you mentioned, Filter option is working fine with DateTime column(i.e. BirthDate in our sample).However we have attached our sample too. So Please download our sample and do let us know if your are able to reproduce the issue in our sample.

Forum_54269.zip

Thanks for using Syncfusion Products.

Regards,
Gokulkumar.B


JA Jahmai January 5, 2007 03:12 PM UTC

Hello Gokulkumar.

I have attached a project demonstration which shows my problem.

The project consists of just a default.aspx page and a sql server express database with 1 table for demo purposes.

The steps I took to bind and provide filtering capabilities on the grid were as follows:

1. Drag a Grid Grouping control onto the default.aspx page

2. From the context menu of the control select New DataSource

3. Attach to my sql server table and select all columns from the Contacts table

4. Set AllowFilter=true for all columns

5. Set ShowFilterBar=true in TableDescriptor.TopLevelOptions

6.Do a databind of the grid in the Page_Init function

7.Run the application

Please tell me what I am doing wrong.


Filtering works with all my access tables but not my sqlserver tables.

Thanks
Jahmai




JA Jahmai January 5, 2007 03:23 PM UTC

Ensuring there was an attachment.

FilterTest.zip


JA Jahmai January 5, 2007 04:13 PM UTC

I appeared to have found the cause of the problem.
If the datetime field has a time attached e.g 1/2/2006 9:45:00 AM, then the filter for the column does not work.

Is there anyway around this?


JA Jahmai January 5, 2007 04:40 PM UTC

It appears that any data containing the ":" character cannot be filtered.


GB Gokul B Syncfusion Team January 6, 2007 12:46 AM UTC

Hi Jahmai,

Thanks for your attachment.We could see this issue in your sample. So we need to look bit more regarding this issue and let you know later within "Tuesday". However, Could you please update us if you are able to reproduce the issue in our perviously attached sample too in this post.

Thanks for using Syncfusion product.

Regards,
Gokulkumar.B



JA Jahmai January 8, 2007 04:04 PM UTC

In order to reproduce the error in your sample, just put a ":" in any field of the data being displayed.

For instance, in the northwind database employees table, changing the first employee's name from "Nancy" to "Nancy:", the data cannot be filtered for the name "Nancy:".

In other words, as long as the data contains a ":" character, you cannot filter the data for that particular piece of information.


GB Gokul B Syncfusion Team January 10, 2007 12:33 AM UTC

Hi Jahmai,

Thanks for your update. It help us to reproduce the issue.As you mentioned filter is not working when the data contains ":" character. This might be a bug.However we will check bit more on this for some possible workaround and let know later tommorrow.

Thanks for using syncfusion products.

Regards,
Gokulkumar.B


GB Gokul B Syncfusion Team January 10, 2007 11:02 PM UTC

Hi Jahmai,

We noticed that Record Filter is not working as long as when the data contains ":" characters(Ex:DateTime Field).But It is working fine when Record filter is hard coded like shown below.

//Filter the Record between the specified range.
this.GridGroupingControl1.TableDescriptor.RecordFilters.Add("[Birthdate] Between {12/11/2006 11:02 AM,12/11/2006 11:02 AM}");

So we confirm this as a bug and Filed a bug report in our Internal Defect Tracking System. We have requested our developer to provide more information regarding the timeframe to fix this issue. Hope we can provide you with more information within a 12 days.

Sorry for the incovenience caused.

Let us know if you need any other assistance.

Thanks for using Syncfusion products.

Regards,
Gokulkumar.B


GB Gokul B Syncfusion Team January 23, 2007 11:47 PM UTC

Hi Jahmai,

I regret for the delay in getting back to you.

I am afraid I have not heard back from the development team yet but will follow up again and update you within 7 days.Sorry for the delay.

Thanks for using Syncfusion product.

Regards,
Gokulkumar.B


GB Gokul B Syncfusion Team February 1, 2007 12:37 AM UTC

Hi Jahmai,

I very much appreciate your patience on this issue. The development is on going for this issue and the fix will be available on March 5th.

Thanks for using Syncfusion products.

Regards,
Gokulkumar.B


SS Suresh Sekarean Syncfusion Team May 23, 2007 09:20 AM UTC

Hi Jahmai,

Sorry for the delay in response.

A defect report has been logged for this issue. You can keep track of the progress of the issue from the below link

http://www.syncfusion.com/support/issues/grid/Default.aspx?ToDo=view&questId=3354

We have forwarded this issue to our developers and will update you with the fix for the same on or before June, 25th, 2007.

Please let us know if you have any queries.

Regards,
Sureshsekaran.


SS Suresh Sekarean Syncfusion Team June 21, 2007 11:55 AM UTC

Hi Jahmai,

Could you please open an incident in the direct trac with the forum id as the subject line, so that we can send you the necessary information?

http://www.syncfusion.com/Support/DirectTrac/logon.aspx

Regards,
Sureshsekaran.

Loader.
Live Chat Icon For mobile
Up arrow icon