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

Hide filter for a column in a Pivot Grid

1 Answer 174 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Rama
Top achievements
Rank 1
Rama asked on 20 Nov 2013, 02:53 PM
I have been using the telerik controls for my asp.net web application, I have used PivotGrid telerik control and I have set filters for all the columns in it. Now I need one column filter to be hidden, Is this possible? If so could you tell me how this can be achieved. I have attached an image that has the layout of my requirement.

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 25 Nov 2013, 11:20 AM
Hello Rama,

With the current implementation of the RadPivotGrid, you could not set any property to disable filtering for particular field/column, but you could try searching for the filter button within the RadPivotGrid and set the visible property to false. Here is a code snippet with the described approach:
protected void RadPivotGrid1_PreRender(object sender, EventArgs e)
{
    Control filterButton = FindControlRecursive(RadPivotGrid1, "StationName_FilterPictButton");
 
    if (filterButton != null)
    {
        filterButton.Visible = false;
    }
}
 
public static Control FindControlRecursive(Control control, string id)
{
    if (control == null) return null;
    Control ctrl = control.FindControl(id);
 
    if (ctrl == null)
    {
        foreach (Control child in control.Controls)
        {
            ctrl = FindControlRecursive(child, id);
 
            if (ctrl != null) break;
        }
    }
    return ctrl;
}

Hope that helps.


Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
PivotGrid
Asked by
Rama
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or