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

Disable Filter Controls

2 Answers 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 19 Jul 2011, 09:33 AM

Hello,

in my Grid, I set AllowFilteringByColumn=true, so that a User A can filter the Grid. Then i want to disable (or invisible) the Filter Controls, so that a User B can see the Filters of the filtered Grid, but User B should not change the Filters.

Is this possible?

Best Regards

Tom

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 19 Jul 2011, 10:17 AM
Hello Thomas,

Try the following code snippet in PreRender event to disable the filter controls.

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
        GridFilteringItem filteringItem = (GridFilteringItem)RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)[0];
        if (Session["UserName"] == "User A")
        {
            filteringItem.Visible = false;
        }
        else
        {
           filteringItem.Visible = true;
        }
}

Thanks,
Princy.
0
Thomas
Top achievements
Rank 1
answered on 19 Jul 2011, 01:59 PM
Hello Princy,

thank you very much! It works fine!

Best Regards

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