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

hide filter if the grid is empty

1 Answer 45 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dawson
Top achievements
Rank 1
Dawson asked on 07 Jan 2014, 01:24 PM
Hi
i want to hide filter if the grid is empty.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Jan 2014, 01:37 PM
Hi Dawson,

Please try the following code snippet to hide filtering when RadGrid is empty:

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    int count = RadGrid1.MasterTableView.Items.Count;
    if (count == 0)
    {
        RadGrid1.AllowFilteringByColumn = false;
        RadGrid1.Rebind();
    }      
}

Thanks,
Shinu
Tags
Grid
Asked by
Dawson
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or