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.

How to initialize grid filter with GridOffice2007Filter?

Thread ID:

Created:

Updated:

Platform:

Replies:

96145 Aug 24,2010 07:12 AM Sep 15,2010 01:45 AM Windows Forms 5
loading
Tags: GridControl
Raphael
Asked On August 24, 2010 07:12 AM

Hello,

I use a GridOffice2007Filter for a GridGrouping control.

I would like to initialize this filter by checking just 2 or 3 elements for a column (there are 5 elements).

Example : in the column, the elements are "Planned", "Closed", "Delay", "Not planned" and "On going" and I would like to initialize with "Planned", "Delay" and "On going".

Could you help me please?

Thanks in advance.

Sincerely,

Raphaël.

Jisha Joy [Syncfusion]
Replied On August 26, 2010 06:30 AM

Hi Raphaël,

Thank you for using Syncfusion products.

You could achieve the desired behavior by allowing the filter only to the columns you want. See the code:

GridOffice2007Filter filter = new GridOffice2007Filter();
this.gridGroupingControl1.TableDescriptor.Columns["Planned"].AllowFilter = true;
this.gridGroupingControl1.TableDescriptor.Columns["Delay"].AllowFilter = true;
this.gridGroupingControl1.TableDescriptor.Columns["onGoing"].AllowFilter = true;
filter.WireGrid(this.gridGroupingControl1);

Regards,
Jisha

Raphael
Replied On August 26, 2010 08:15 AM

Hi,

All right, so it is impossible in a specific column to initialize the element to filter?

Because "Planned, "On going",... are not columns but values in a specific column which name is "STATUS".

That is why I would like to check, at launch, those values in the filter for the column "STATUS" in order to have only the value "Planned", for example.

Nevertheless, the user can change the filter, after launch, and then check values unchecked in the filter for the specific column "STATUS", which are not visible at the beginning.

I don't know if I explain clearly... it is not easy.

Thanks in advance.

Sincerely,

Raphaël.

Jisha Joy [Syncfusion]
Replied On August 27, 2010 03:03 AM

Hi,

You could achieve the desired behavior by using the RecordFilterDescriptor and specifying the required filter condition.

this.gridGroupingControl1.TableDescriptor.RecordFilters.Clear();
RecordFilterDescriptor filter1 = new RecordFilterDescriptor("[Col1] > 200"); this.gridGroupingControl1.TableDescriptor.RecordFilters.Add(filter1);


Regards,
Jisha

Raphael
Replied On September 14, 2010 03:26 AM

Hello,

Indeed, it works!
Thank you very much for your help.

Have a nice day!

Sincerely,

Raphaël.


Christopher Issac Sunder K [Syncfusion]
Replied On September 15, 2010 01:45 AM

Hi Raphaël,

Glad to know that the issue get resolved in your side.

Thank you for using Syncfusion products.

Regards,
Christo.


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.

;