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

RecordFilterDescriptor and FilterCondition help

I have the fllw RecordFilter. The intended behavior is SellingTitle=''AMOK'' AND Viewing > 0.

However, the filter is returning doing
SellingTitle=''AMOK'' OR Viewing > 0 because some Title being return have a Viewing=0.

Can you show me the syntax for doing someting like col1=''A'' AND col2=''B'' and col3=''C''?

fc = new FilterCondition(FilterCompareOperator.Equals, "AMOK");
rfd = new RecordFilterDescriptor();
rfd.Name = "Title";
rfd.Conditions.Add(fc);
this.gridGroupingControl1.TableDescriptor.RecordFilters.Add(rfd);

fc = new FilterCondition(FilterCompareOperator.GreaterThan, 0);
rfd = new RecordFilterDescriptor();
rfd.Name = "Viewing";
rfd.Conditions.Add(fc);
this.gridGroupingControl1.TableDescriptor.RecordFilters.Add(rfd);

1 Reply

AD Administrator Syncfusion Team September 20, 2006 09:42 AM UTC

Hi James,

This is a default behaviour of the grid. You can change this behaviour by setting RecordFilters.LogicalOperator property to FilterLogicalOperator.Or. Try the below code snippet for the condition "''''AMOK'''' OR Viewing > 0".

FilterCondition fc = new FilterCondition(FilterCompareOperator.Equals, "AMOK");
RecordFilterDescriptor rfd = new RecordFilterDescriptor();
rfd.Name = "Title";
rfd.Conditions.Add(fc);

this.grid.TableDescriptor.RecordFilters.Add(rfd);

fc = new FilterCondition(FilterCompareOperator.GreaterThan, 0);
rfd = new RecordFilterDescriptor();
rfd.Name = "Viewing";
rfd.Conditions.Add(fc);

this.grid.TableDescriptor.RecordFilters.LogicalOperator = FilterLogicalOperator.Or;
this.grid.TableDescriptor.RecordFilters.Add(rfd);

Sample: http://www.syncfusion.com/Support/user/uploads/GGCUpdate_686fda30.zip

Let me know if you need any further assistance.

Thanks,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon