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.
Unfortunately, activation email could not send to your email. Please try again.

Problem with filtering Date using Gridfilterbar

Thread ID:

Created:

Updated:

Platform:

Replies:

62079 Jun 7,2007 08:04 AM Jun 8,2007 05:45 PM Windows Forms 3
loading
Tags: GridControl
Pradeep Kumar
Asked On June 7, 2007 08:04 AM

Hi,

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.

Thanks
-Pradeep


FilterBarRounding_21720.zip

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

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.
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=29956

Regards,
Rajagopal

Pradeep Kumar
Replied On June 8, 2007 09:57 AM

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.

Thanks
-Pradeep



GDBG_FilterBar_Dates.zip

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

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
http://websamples.syncfusion.com/samples/Grid.Windows/F62079/main.htm

Regards,
Rajagopal

CONFIRMATION

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.

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.

;