Please see the picture attached - I 'd like to display only the green options,
thank you
1 Answer, 1 is accepted
1
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 06 Mar 2023, 06:05 AM
Hello, Cristi,
I have prepared a sample code snippet demonstrating how to hide the "Custom" option from the Excel-like filter popup:
publicRadForm1()
{
InitializeComponent();
this.radGridView1.EnableFiltering = true;
this.radGridView1.ShowHeaderCellButtons = true;
this.radGridView1.FilterPopupInitialized += RadGridView1_FilterPopupInitialized;
}
privatevoidRadGridView1_FilterPopupInitialized(object sender, FilterPopupInitializedEventArgs e)
{
RadListFilterPopup popup = e.FilterPopup as RadListFilterPopup;
if (popup!=null)
{
foreach (RadItem item in popup.Items)
{
if (item.Text == RadGridLocalizationProvider.CurrentProvider.GetLocalizedString(RadGridStringId.FilterMenuAvailableFilters))
{
RadMenuItem availableFilters = item as RadMenuItem;
foreach (RadItem subItem in availableFilters.Items)
{
if (subItem.Text == RadGridLocalizationProvider.CurrentProvider.GetLocalizedString(RadGridStringId.FilterOperatorCustom))
{
subItem.Visibility = ElementVisibility.Collapsed;
}
}
}
}
}
}
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.