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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Custom filter dialog in GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

49778 Sep 26,2006 05:38 PM UTC Feb 16,2007 10:54 PM UTC WinForms 9
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On September 26, 2006 05:38 PM UTC

Hello!
How could I use custom filter dialog in GridGroupingControl?
And also I''d like to change default string constants like "All", "Custom" and "None".

I use 3.2.1.0 version.

Thanks!

Administrator [Syncfusion]
Replied On September 27, 2006 04:19 AM UTC

Hi Lev,

Issue 1: Change the All, Custom and None options in a filterbar

To customize the filterbar cell, you need to implement a custom filterbar cell deriving the cellmodel / cellrenderer from GridTableFilterBarCellModel / GridTableFilterBarCellRenderer. Please refer the KnowledgeBase Article for more details.

http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=323

Issue 2: Custom Filter Dialog.

You can handle the TableControlCurrentCellShowingDropDown event and display your own custom filter dialogbox whenever the filterbar "custom" option is selected. Please refer the attached sample for more details.

http://www.syncfusion.com/Support/user/uploads/CustomFilter_a65382.zip

Let me know if you face any issues when implementing the above.

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On September 28, 2006 01:54 PM UTC

Thank you!

But there is a dissapointing bug in "Custom Filter Dialog" example.

1. In any column choose "(Custom...)" and fill some condition. Press OK. It works.
2. Just click again on the same filter combobox - you get automatically filtred rows by one of the combobox item! I think that''s a bug :)

How could I fix it?

Thanks!

Administrator [Syncfusion]
Replied On September 29, 2006 06:09 AM UTC

Hi Lev,

To clear the record filter when the filter bar is not closed properly, you need to handle the gridTableControlCurrentCellCloseDropDown event and remove the record filter using RecordFilter.Remove method. Below is a code snippet.

private void gridTableControlCurrentCellCloseDropDown(object sender, Grouping.GridTableControlPopupClosedEventArgs e)
{
if( e.Inner.PopupCloseType != Syncfusion.Windows.Forms.PopupCloseType.Done)
{
GridTableCellStyleInfo Style = e.TableControl.CurrentCell.Renderer.CurrentStyle as GridTableCellStyleInfo;
if (table.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.FilterBar )
{
e.TableControl.TableDescriptor.RecordFilters.Remove(Style.TableCellIdentity.Column.Name);
}
}
}

Thanks,
Haneef

Administrator [Syncfusion]
Replied On October 2, 2006 08:22 AM UTC

Hi, Haneef!

Unfortunately the problem doesn''t disappear.

Here it is: after successful custom filtration a click on any table cell leads to another filtration at the same column.

Thanks!

Administrator [Syncfusion]
Replied On October 3, 2006 09:35 AM UTC

Hi Lev,

I was not able to reprodue this problem here, please see the attached sample that works fine in Filter bar in the grid.

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/CustomFilterModified_ad33be24.zip

If this did not help, please update us with a sample project showing the problem.

Thanks,
Haneef

Administrator [Syncfusion]
Replied On October 3, 2006 05:35 PM UTC

Hi, Haneef!

I''ve tried your modified example, but the problem presents nevertheless.

So, I thought it could be because of the old Essential Studio version installed on my computer. I''ve installed the latest 4.3.0.30 version, but the problem keeps on:
1. Choose (Custom...) item in filter combobox, fill some condition and press OK.
2. Click on any cell at the table and you get the table filtered by the 9th from the bottom combobox item!

The thing is that (Custom...) item is the second item in the list, and if you manually scroll the combobox to the end, the 9th item from the bottom will be the _second_ item in the visible part of the list. (There are 10 visible items in combobox on my computer; on the computer next to mine there are 6 visible combobox items, and the 5th item from the bottom is automatically selected.)

When I place brakepoint at 266 line of Form1.cs at ListBoxPart_Click() function
=============
if(list.SelectedIndex == 1)
=============
and just continue after each brake, the problem partially disappears:
after successful custom filtration a click on any table cell leads to calling of ListBoxPart_Click(), but all runs correctly.

What do you think on it?

Administrator [Syncfusion]
Replied On October 4, 2006 10:29 AM UTC

Hi Lev,

We haven''t seen the Custom filter problem of "XP SP2 +VS 2003 version + Essential Studio 4.1/4.3.". We have tested the sample with Essentail Studio many time, but we haven''t reproduce the issue in our system. If you give more information about this issue, we will try debugging here.

Let me know if i am missing something.

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On October 4, 2006 05:54 PM UTC

Hi, Haneef!

I have the same system configuration, so I don''t know, what the main difference is there.

But fortunately, I''ve made it to work! :)
I had to change considerably the handlers logic.

If you interested in it, there is the attachment.

Best regards,
Lev

CustomFilterModified-2.zip

Administrator [Syncfusion]
Replied On February 16, 2007 10:54 PM UTC



>Hi Lev,

To clear the record filter when the filter bar is not closed properly, you need to handle the gridTableControlCurrentCellCloseDropDown event and remove the record filter using RecordFilter.Remove method. Below is a code snippet.

private void gridTableControlCurrentCellCloseDropDown(object sender, Grouping.GridTableControlPopupClosedEventArgs e)
{
if( e.Inner.PopupCloseType != Syncfusion.Windows.Forms.PopupCloseType.Done)
{
GridTableCellStyleInfo Style = e.TableControl.CurrentCell.Renderer.CurrentStyle as GridTableCellStyleInfo;
if (table.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.FilterBar )
{
e.TableControl.TableDescriptor.RecordFilters.Remove(Style.TableCellIdentity.Column.Name);
}
}
}

Thanks,
Haneef

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.

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

;