Search code examples
c#winformstelerikradgridview

Disable Excel-Like filtering for Some columns - Telerik C# Winforms


By enabling Excel-Like filtering for RadGridView all of the columns will have a filter button. I need to disable Excel-Like filtering for some specific columns and hiding the excel filtering button for that column. Is this possible?


Solution

  • I just found the solution using RadControlSpy, for hiding a excel-like filtering button I should manage ViewCellFormatting event like this:

    private void gridShop_ViewCellFormatting(object sender, CellFormattingEventArgs e)
    {
        if (e.CellElement is GridHeaderCellElement && e.Column.Name == "IDCol")
            (e.CellElement as GridHeaderCellElement).FilterButton.Visibility = ElementVisibility.Collapsed;
    }