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

[Solved] Hide/Show Filter in JS does not work when initially hidden

1 Answer 127 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Randy
Top achievements
Rank 1
Randy asked on 02 Sep 2009, 06:44 PM
I am struggling with enabling/disabling filtering on the client side.  I have a grid that I would like to toggle showing/hiding the filter row on the client side.  However, what I noticed was that the client side functions don't work unless the initial grid has the AllowFilteringByColumn property is set to true.   I see a bunch of threads on this subject but nothing seems like an exact match. 

Also as someone mentioned in one of the other threads,  the basic Filtering demo here has the same problem.  Rework the demo to have the filter initially not shown and you will see the problem I am having.  It works correctly as long as the initial display is ON.  I plan on having this be a user setting that I store off to a cookie or session variable.  

Randy

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 07 Sep 2009, 10:21 AM
Hi Randy,

The filtering feature for the Grid will be enabled only when the AllowFilteringByColumn property is set to true. You may try the following code snippet to initially hide the filtering item of RadGrid.

CS:
 
 protected void RadGrid2_PreRender(object sender, EventArgs e) 
    { 
        (RadGrid2.MasterTableView.GetItems(GridItemType.FilteringItem)[0] as GridFilteringItem).Display = false
 
    }  


Thanks
Princy
Tags
Grid
Asked by
Randy
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or