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

How to initialize grid filter with GridOffice2007Filter?

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.

5 Replies

JJ Jisha Joy Syncfusion Team August 26, 2010 10:30 AM UTC

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


RA Raphael August 26, 2010 12:15 PM UTC

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.


JJ Jisha Joy Syncfusion Team August 27, 2010 07:03 AM UTC

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


RA Raphael September 14, 2010 07:26 AM UTC

Hello,

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

Have a nice day!

Sincerely,

Raphaël.



CI Christopher Issac Sunder K Syncfusion Team September 15, 2010 05:45 AM UTC

Hi Raphaël,

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

Thank you for using Syncfusion products.

Regards,
Christo.


Loader.
Live Chat Icon For mobile
Up arrow icon