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.

Changing default filter type in GridDynamic filter

Thread ID:

Created:

Updated:

Platform:

Replies:

107471 Mar 4,2013 11:33 AM Mar 7,2013 07:37 AM Windows Forms 6
loading
Tags: Grouping
Robin Tanner
Asked On March 4, 2013 11:33 AM

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 9.3.0.61

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


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

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.

Regards,
Athiram S


Robin Tanner
Replied On March 5, 2013 05:50 AM

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

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

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.

regards,
Athiram S




Robin Tanner
Replied On March 5, 2013 07:44 AM

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 08:43 AM

This worked for me. Thank you very much.

Athiram S [Syncfusion]
Replied On March 7, 2013 07:37 AM

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.

Regards,
Athiram S


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.

;