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

How to apply Filters to Grid Grouping Control

Hi,

I am using RecordFilterDescriptor to filter the records in Grid Grouping Control(version 4.202.0.60) . I have two filters i.e ShowAllRecords, ShowRecordsWithStatCode 1. The first filter shoud show all records but when I apply the first filter after the second filter the grid is only showing only few records. Please help me with this issue. The Grid Grouping Control has nested tables with relations

public void UpdateFilters()
{
if (this.ShowAllExcps)
{
StatFilterDescriptor.Expression = "";
DTableDescriptor.RecordFilters.Remove("EXCPSTATUSFILTER");

}
else
{
//To filter the records that with Status code as 1.
StatFilterDescriptor.Expression = "[STAT_CODE] = 1";
DTableDescriptor.RecordFilters.Add(ExcpStatusFilterDescriptor);
}

this.gridGroupingControl1.Refresh();
}

2 Replies

HA haneefm Syncfusion Team April 30, 2007 11:56 PM UTC

Hi Uma,

To filter the data in the GridGroupingControl, create an instance of a RecordFilterDescriptor and add it to the RecordFilters collection in the TableDescriptor. The RecordFilterDescriptor will allow you to specify a string that holds a logical expression using any of the other fields in the data.

[C#]
// Adds a record filter that requires Col1 to be less than 4.
RecordFilterDescriptor rfd = new RecordFilterDescriptor("[Col1] < 4");
this.gridGroupingControl1.TableDescriptor.RecordFilters.Add(rfd);

Also refer the following browser sample under the FiltersAndRelationship category ( C:\Program Files\Syncfusion\Essential Studio\4.4.0.49\Windows\Grid.Grouping.Windows\Samples\FiltersAndExpressions\ )for more details.
FilterTutorial Sample-This sample demonstrates the creation of filters at design time.
Filter Sample -Filters can be set by setting the ShowFilterBar and allowFilter property. The AllowFilter can be set for the columns that require filter options.

Best regards,
Haneef


UD Uma Datla May 1, 2007 04:05 PM UTC

Hi Haneef,

Thanks for the reply. I have already looked in to the sample that you mentioned below. As you suggested I have set the Allowfilter for the column that requires filters. In my screen the filters are working but in the Grid the filtered rows are overlapping the other rows as shown in the screen shot. I have called this.gridgroupingControl.refresh() after adding filters; Please see the attachments for more details. I think the issue is with grid redraw after applying filters Please help me with this issue.













>Hi Uma,

To filter the data in the GridGroupingControl, create an instance of a RecordFilterDescriptor and add it to the RecordFilters collection in the TableDescriptor. The RecordFilterDescriptor will allow you to specify a string that holds a logical expression using any of the other fields in the data.

[C#]
// Adds a record filter that requires Col1 to be less than 4.
RecordFilterDescriptor rfd = new RecordFilterDescriptor("[Col1] < 4");
this.gridGroupingControl1.TableDescriptor.RecordFilters.Add(rfd);

Also refer the following browser sample under the FiltersAndRelationship category ( C:\Program Files\Syncfusion\Essential Studio\4.4.0.49\Windows\Grid.Grouping.Windows\Samples\FiltersAndExpressions\ )for more details.
FilterTutorial Sample-This sample demonstrates the creation of filters at design time.
Filter Sample -Filters can be set by setting the ShowFilterBar and allowFilter property. The AllowFilter can be set for the columns that require filter options.

Best regards,
Haneef


Filters.zip

Loader.
Live Chat Icon For mobile
Up arrow icon