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

Hiding Filter Row

2 Answers 250 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Russ
Top achievements
Rank 1
Russ asked on 22 Feb 2009, 11:45 PM
Is there a way to make the filter row of a grid initially hidden?

I am using a grid with filtering. I have a checkbox on my page that will show/hide the filter row via javascript call - all working fine. I just want the filter row to be initially hidden until the user clicks the checkbox to show it.

Would love to be able to set the initial visilbility state of the filter row server-side as the page initially loads or declaritvely in the page markup.

I am using RadGrid for ASP.NET AJAX - 2008.3

Thanks for your help... Russ

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 23 Feb 2009, 05:22 AM
Hi Russ,

Try the following code snippet in the Prerender event of the Grid to hide the GridFilteringItem.

CS:
 protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        if (!IsPostBack) 
        { 
            foreach (GridFilteringItem filter in RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)) 
            { 
                filter.Style.Add("Display""none"); 
            } 
        } 
    } 


Thanks
Shinu



0
Russ
Top achievements
Rank 1
answered on 23 Feb 2009, 05:35 PM
Thanks Shinu - that was exactly what I was looking for!

I appreciate your help... Russ
Tags
Grid
Asked by
Russ
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Russ
Top achievements
Rank 1
Share this question
or