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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Changing default filter type in GridDynamic filter

Thread ID:





107471 Mar 4,2013 04:33 PM UTC Mar 7,2013 12:37 PM UTC WinForms 6
Tags: Grouping
Robin Tanner
Asked On March 4, 2013 04:33 PM UTC

I am using GridDynamicFilter for my grouping grid and when i enter text in filter box and click on enter, it is searching based on "Starts With", but i need to search it based on "Equals" by default. Is there any way to do this.

I am using

My Code:
            GridDynamicFilter filter = new GridDynamicFilter();
            filter.ApplyFilterOnlyOnCellLostFocus = true;

Athiram S [Syncfusion]
Replied On March 5, 2013 10:10 AM UTC

Hi Robin,

Thanks for your interest in Syncfusion Products.

You can make use of the following code to achieve the result:

  GridTableFilterBarExtCellRenderer rend = this.gridGroupingControl1.TableControl.CurrentCell.Renderer as GridTableFilterBarExtCellRenderer;
RecordFilterDescriptor filter = e.Item as RecordFilterDescriptor;
 filter.Expression = "[" + filter.MappingName + "]" + " " + "Equals" + " " + "'" + rend.TextBox.Text + "'";

Please let me know if you have any concerns.

Athiram S

Robin Tanner
Replied On March 5, 2013 10:50 AM UTC

Thanks for the reply Athiram.
But in which event should I write this code?

Athiram S [Syncfusion]
Replied On March 5, 2013 11:35 AM UTC

Hi Robin,

Sorry for inconvenience.

You need to make use of the code in "RecordFilters.Changing"event and achieve the results.

Please let me know if you have any concerns.

Athiram S

Robin Tanner
Replied On March 5, 2013 12:44 PM UTC

Thanks Athiram
In my case this.TableControl.CurrentCell.Renderer is always null. Do I need to initiate it ?

Robin Tanner
Replied On March 6, 2013 01:43 PM UTC

This worked for me. Thank you very much.

Athiram S [Syncfusion]
Replied On March 7, 2013 12:37 PM UTC

Hi Robin,

Thanks for your update.

We are glad to know that the issue if fixed at your end. If you face any other issues , please open a new forum.

Athiram S


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon