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

Hide filter in edit mode

2 Answers 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 05 Oct 2010, 09:54 PM
Hi all!

I'm using Filter for my RadGrid. And I would like to hide it in the Edit mode.
Using AllowFilteringByColumn is not the good idea. In some cases, I still use the Filter, just want to hide it
Could anyone help me?

Thanks!

Andy.

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Oct 2010, 05:52 AM
Hello Andy,

You can  hide the filtercolumn by setting its visible property to false.Here is the example.
C#:

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)[0].Visible = false;
        }
    }

Regards,
Shinu.
0
Andy
Top achievements
Rank 1
answered on 06 Oct 2010, 03:26 PM
It works now. Thanks Shinu!

Here is the VB code if someone needs

Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
       If (TypeOf e.Item Is GridEditableItem AndAlso CType(e.Item, GridEditableItem).IsInEditMode) Then
 
           RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)(0).Visible = False
 
       End If
 
   End Sub

Andy.
Tags
Grid
Asked by
Andy
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Andy
Top achievements
Rank 1
Share this question
or