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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problem with filtering Date using Gridfilterbar

Thread ID:





62079 Jun 7,2007 12:04 PM UTC Jun 8,2007 09:45 PM UTC WinForms 3
Tags: GridControl
Pradeep Kumar
Asked On June 7, 2007 12:04 PM UTC


I am using GridFilterBar to filter the rows in the grid. It is working fine to filter formatted strings and formatted decimals but i am getting problem while filtering dates using FilterBar.
The attached sample will help you to understand the above mentioned problem.

I tried by giving different formats to the dates in filter bar. In Form1_Load i commented some code which is used to format the date fields of filter bar.

In both the cases i am unable to filter the dates in the grid. So please comeup with a solution as it is an urgent need for me.



Rajagopal [Syncfusion]
Replied On June 7, 2007 09:19 PM UTC

Hi Pradeep,

The GridDataBoundGrid uses the DataView.RowFilter property to handle filtering that requires #'s around dates.

Here is a forum thread that discusses this.


Pradeep Kumar
Replied On June 8, 2007 01:57 PM UTC

Hi Rajagopal,

Thanks for your response. I am able to filter dates with the code snippet sent by you. But i am not able to filter the time values. If i format the dates to display only time values then it is not filtering those values.

The attached sample will help you to understand the problem i got. Please comeup with a solution to this problem.



Rajagopal [Syncfusion]
Replied On June 8, 2007 09:45 PM UTC

Hi Pradeep,

The problem is that the DataView.RowFilter is getting failed in this aspect. You could see the same issue when applying the DataView.RowFilter to the DataGrid.

To get this working properly, set the milliseconds value to zero in the DateTime constructor. Please refer to the modified sample below that works fine.

DateTime tt = DateTime.Today;
DateTime date = new DateTime(tt.Year, tt.Month, tt.Day, tt.Hour, tt.Minute, tt.Second, 0);

Here is the sample download link



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon