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.

How to delete "Custom" from filter bar in ggc?

Thread ID:

Created:

Updated:

Platform:

Replies:

92014 Dec 14,2009 10:16 AM Dec 15,2009 05:24 AM Windows Forms 5
loading
Tags: GridControl
Rafal Kasprzyk
Asked On December 14, 2009 10:16 AM

I know it was mentioned few times and probably here is an answer http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=323
But the link does not work.

Rafal

Jisha Joy [Syncfusion]
Replied On December 15, 2009 01:00 AM

Hi Rafal,

You could use the following link for the KB:

http://www.syncfusion.com/support/kb/666/How-do-I-hide-the-

Please let me know if this helps.

Regards,
Jisha

Rafal Kasprzyk
Replied On December 15, 2009 03:55 AM

Is it really the only way to do it? There is no chance to get list of elements in filter combobox and delete one ex. "Custom" or "Empty"?

Rafal

Jisha Joy [Syncfusion]
Replied On December 15, 2009 05:10 AM

Hi Raftal,


Here is the code to remove the custom option from the GridGroupingControl FilterBar by just handling two events.

void gridGroupingControl1_TableControlCurrentCellCloseDropDown(object sender, GridTableControlPopupClosedEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
if (cc.Renderer is GridTableFilterBarCellRenderer)
{
GridTableFilterBarCellRenderer renderer = cc.Renderer as GridTableFilterBarCellRenderer;
renderer.ListBoxPart.Items.Add("");
if (renderer.ListBoxPart.SelectedIndex >=1 && renderer.ListBoxPart.SelectedIndex<=renderer.ListBoxPart.Items.Count - 1)
{
renderer.ListBoxPart.SelectedIndex += 1;
}
}
}

void gridGroupingControl1_TableControlCurrentCellShowingDropDown(object sender, GridTableControlCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
if (cc.Renderer is GridTableFilterBarCellRenderer)
{
GridTableFilterBarCellRenderer renderer = cc.Renderer as GridTableFilterBarCellRenderer;
GridTableCellStyleInfo tableStyleInfo = (GridTableCellStyleInfo)renderer.StyleInfo;
renderer.ListBoxPart.Items.RemoveAt(1);
}
}


Please let me know if this helps.

Regards,
Jisha

Rafal Kasprzyk
Replied On December 15, 2009 05:13 AM

Hello,

Thx, it works great.

Rafal

Jisha Joy [Syncfusion]
Replied On December 15, 2009 05:24 AM

Hi Raftal,

Thank you for your update.

Regards,
Jisha

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.

;