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
close icon

Save grid filters in bookmark

Hi.

I would like to know how I could easily save grid filters, so I can restore them later, as in a save/load bookmark model.

The user would select rows by adding one or more filters on several columns (in conjunction with boolean operators). The grid filters could be saved, and restored later, when the user connects again.

I am using C#, ASP.NET, GridGroupingControl.

Any help would be appreciated.

Regards,

Fred

4 Replies

RS Rajarajeswari S Syncfusion Team October 8, 2007 05:51 AM UTC



Hi Fred,

Thanks for evaluating Syncfusion products,

Your Direct Trac Incident has been updated. Please follow this issue in the incident id-37997

Regards,
S.Rajarajeswari



MT Mar Taloma December 17, 2008 06:03 PM UTC

has this been resolved?

i also would like to save the filter information entered by the user.thanks.



RS Rajarajeswari S Syncfusion Team December 18, 2008 10:04 AM UTC

Hi,

Thanks for evaluating Syncfusion products.

You can access the GridRecordFilters collection to get the current filters along with there expression text. Use the following code snippet to achieve this,

GridRecordFilterDescriptorCollection rec = this.GridGroupingControl1.TableDescriptor.GridRecordFilters;

Then you can browse through the collection data and save the details which relates with the filtering.

- > "rec[0].Conditions" - Conditions collections for the first record of data in the filters.
Other details associated with Conditions collection,

rec[0].Conditions[0].CompareText
rec[0].Conditions[0].CompareOperator
rec[0].Conditions[0].CustomFilter

A sample code snippet that you would use for adding filters through code,

GridRecordFilterDescriptor gfd = new GridRecordFilterDescriptor();
gfd.Name = "Country";
gfd.Conditions.Add(Syncfusion.Grouping.FilterCompareOperator.Equals, "Germany");
this.GridGroupingControl1.TableDescriptor.GridRecordFilters.Add(gfd);

You can save these collection data in an external file or datasource. Then use them back again.

Please let me know if this helps you out.

Thanks,
Raji




MT Mar Taloma January 23, 2009 04:52 PM UTC

just bought the product and quite new at this. can you please share a code snippet to loop thru all the columns of the grid as it is possible that the user can set filters on more than one column.

question:
is there a plan to add a grid-filter option to allow saving of the grid filter(s) between postbacks?

thanks again.


>Hi,

Thanks for evaluating Syncfusion products.

You can access the GridRecordFilters collection to get the current filters along with there expression text. Use the following code snippet to achieve this,

GridRecordFilterDescriptorCollection rec = this.GridGroupingControl1.TableDescriptor.GridRecordFilters;

Then you can browse through the collection data and save the details which relates with the filtering.

- > "rec[0].Conditions" - Conditions collections for the first record of data in the filters.
Other details associated with Conditions collection,

rec[0].Conditions[0].CompareText
rec[0].Conditions[0].CompareOperator
rec[0].Conditions[0].CustomFilter

A sample code snippet that you would use for adding filters through code,

GridRecordFilterDescriptor gfd = new GridRecordFilterDescriptor();
gfd.Name = "Country";
gfd.Conditions.Add(Syncfusion.Grouping.FilterCompareOperator.Equals, "Germany");
this.GridGroupingControl1.TableDescriptor.GridRecordFilters.Add(gfd);

You can save these collection data in an external file or datasource. Then use them back again.

Please let me know if this helps you out.

Thanks,
Raji





Loader.
Live Chat Icon For mobile
Up arrow icon