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.

GGC->RecordFilters and disjunction

Thread ID:

Created:

Updated:

Platform:

Replies:

58295 Mar 21,2007 03:23 PM Mar 22,2007 01:55 PM Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 21, 2007 03:23 PM

Hi!

I have a GGC and I want to set 2 RecordFilters. But the filters should work as a disjunction;

data: filter[col1] OR filter[col2]


Is there a way to manage this?


Regards
Falk

Administrator [Syncfusion]
Replied On March 21, 2007 05:49 PM

Hi Falk,

You can try this code.

RecordFilterDescriptor rf1 = new RecordFilterDescriptor("Col3", FilterLogicalOperator.Or,new FilterCondition[] { new FilterCondition(FilterCompareOperator.Like , "Column3CellValue")});
RecordFilterDescriptor rf2 = new RecordFilterDescriptor("Col4", FilterLogicalOperator.Or,new FilterCondition[] { new FilterCondition(FilterCompareOperator.Like, "Column4CellValue")});

this.gridGroupingControl1.TableDescriptor.RecordFilters.Add(rf1);
this.gridGroupingControl1.TableDescriptor.RecordFilters.LogicalOperator = FilterLogicalOperator.Or;
this.gridGroupingControl1.TableDescriptor.RecordFilters.Add(rf2);

Best regards,
Haneef

Administrator [Syncfusion]
Replied On March 22, 2007 02:31 AM

Ok, this woks.
But what, if I want this:

data: (filter[col1] OR filter[col2]) AND filter[col3] AND filter[col4]


Regards
Falk

Administrator [Syncfusion]
Replied On March 22, 2007 01:55 PM

Hi Falk,

To add a filter condition, add a RecordFilterDescriptor to the Engine.TableDescriptor.RecordFilters collection. The constructor on the RecordFilterDescription takes an expression data like (filter[col1] OR filter[col2]) AND filter[col3] AND filter[col4]. Here is a code snippet to show this.

RecordFilterDescriptor rf1 = new RecordFilterDescriptor("[Col1] Like 'Column1' OR [Col2] Like 'Column2'");
RecordFilterDescriptor rf2 = new RecordFilterDescriptor("[Col3] = '5'");
RecordFilterDescriptor rf3 = new RecordFilterDescriptor("[Col4] > '7'");

this.gridGroupingControl1.TableDescriptor.RecordFilters.Add(rf1);
this.gridGroupingControl1.TableDescriptor.RecordFilters.Add(rf2);
this.gridGroupingControl1.TableDescriptor.RecordFilters.Add(rf3);

Best regards,
Haneef

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.

;