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.

Problems Filtering GridGroupingControl

Thread ID:





63792 Jul 10,2007 03:12 AM Jul 14,2007 12:42 AM Windows Forms 3
Tags: GridControl
Tim Cristofoli
Asked On July 10, 2007 03:12 AM


I am trying to filter records in a gridgroupingcontrol based on the values in 3 columns. It seems like it should be an easy thing to do but I cannot seem to get correct results.

My grid has a "service code" column with a code for a service type like "0", "1", "2", "A", "B", "C" etc., an "authorised" column that has a string value of either "0" or "1" and a "preferred" column that has a string of either "0" or "1" as well. The user is supposed to be able to select any combination of "service code", "authorised" and "preferred" values and the grid should display only the records that match the selected values.

For example, if I want to show only records where (("service code" = "1") and ("authorised" = "0") and ("preferred" = "1" or "preferred" = "0")) then a simplified version of my code looks like this:

private void filterGrid()
ggc.TableDescriptor.RecordFilters.LogicalOperator = FilterLogicalOperator.And;

String servicesFilterString = "([SERVICE_CODE] = '1')";
String authorisedFilterString = "([AUTHORISED] = '0')";
String preferredFilterString = "([PREFERRED] = '1' OR [PREFERRED] = '0')";

RecordFilterDescriptor rfd1 = new RecordFilterDescriptor(servicesFilterString);

RecordFilterDescriptor rfd2 = new RecordFilterDescriptor(authorisedFilterString);

RecordFilterDescriptor rfd3 = new RecordFilterDescriptor(preferredFilterString);


For some reason this approach doesn't seem to be working. For example, if I construct the "preferred" filter string as "([PREFERRED] = '1' OR [PREFERRED] = '0')" then the filter works as expected; however, if I construct it in the reverse order "([PREFERRED] = '0' OR [PREFERRED] = '1')" it doesn't filter the grid correctly (for example, all rows are filtered out of the grid when all rows should be displayed). Similarly, the order that of the conditions in the "services" filter string seems to affect whether the grid is filtered correctly and for certain seemingly random values all records in the grid are filtered out inexplicably. I can't see any reason why the order of the conditions should have any effect on the results.

Any help with this problem will be much appreciated!


Tim Cristofoli
Replied On July 10, 2007 03:18 AM

By the way, I am using Syncfusion version

Administrator [Syncfusion]
Replied On July 10, 2007 04:06 AM

Try removing the TIC marks.

String servicesFilterString = "([SERVICE_CODE] = 1)";
String authorisedFilterString = "([AUTHORISED] = 0)";
String preferredFilterString = "([PREFERRED] = 1 OR [PREFERRED] = 0)";

Tim Cristofoli
Replied On July 14, 2007 12:42 AM

That seems to have fixed it. Thanks for the super quick help!!


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.