AD
Administrator
Syncfusion Team
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=323Issue 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.zipLet me know if you face any issues when implementing the above.
Best Regards,
Haneef
AD
Administrator
Syncfusion Team
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!
AD
Administrator
Syncfusion Team
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
AD
Administrator
Syncfusion Team
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!
AD
Administrator
Syncfusion Team
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?
AD
Administrator
Syncfusion Team
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
AD
Administrator
Syncfusion Team
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
AD
Administrator
Syncfusion Team
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