This is a migrated thread and some comments may be shown as answers.

Excel-like available filter off

3 Answers 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Вадим
Top achievements
Rank 1
Iron
Iron
Вадим asked on 16 Feb 2018, 08:36 PM
How on some columns to disconnect available filter?
And in the first column, leave only containce?

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Feb 2018, 09:17 AM
Hello, Вадим, 

Thank you for writing.  

You can enable the filtering functionality for the whole RadGridView but disable it only for specific columns by setting the AllowFiltering property of the column: 

this.radGridView1.Columns[3].AllowFiltering = false;



I hope this information helps. Should you have further questions I would be glad to help. 
 
 Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Вадим
Top achievements
Rank 1
Iron
Iron
answered on 19 Feb 2018, 04:42 PM

You did not understand me.
In the third column, I need to leave only the enumeration of cities (hide the "available filter").

In the first column, put the default "contains".

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 20 Feb 2018, 07:56 AM
Hello, Вадим,  

Thank you for writing back. 

The provided clarification is greatly appreciated. You can handle the FilterPopupInitialized and hide the desired items in the RadListFilterPopup. Here is demonstrated how to hide the "Available Filters" menu item: 


private void radGridView1_FilterPopupInitialized(object sender, Telerik.WinControls.UI.FilterPopupInitializedEventArgs e)
{
    RadListFilterPopup popup = e.FilterPopup as RadListFilterPopup;
    if (popup != null)
    {
        foreach (RadItem item in popup.Items)
        {
            if (item.Text== Telerik.WinControls.UI.Localization.RadGridLocalizationProvider.CurrentProvider.GetLocalizedString(RadGridStringId.FilterMenuAvailableFilters))
            {
                item.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
            }
        }
    }
}

Following a similar approach you can hide all the items you wish.

I hope this information helps. If you have any additional questions, please let me know. 

 Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Вадим
Top achievements
Rank 1
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Вадим
Top achievements
Rank 1
Iron
Iron
Share this question
or