Hide filter when in edit/add mode

4 posts, 1 answers
  1. MCM Net
    MCM Net avatar
    8 posts
    Member since:
    Dec 2008

    Posted 08 May 2009 Link to this post

    Hi everyone,

    Does anyone know if it's easily possible to hide the filter row in a RadGrid when in edit mode?

    Thanks,

    Steve
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 10 May 2009 Link to this post

    Hi Steve,

    Try the following code snippet and see whether it is working as you expected.

    CS:
     
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
        if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
        { 
            foreach (GridFilteringItem filterItem in RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)) 
            { 
                filterItem.Visible = false
            } 
        } 

    Thanks,
    Shinu.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. MCM Net
    MCM Net avatar
    8 posts
    Member since:
    Dec 2008

    Posted 13 May 2009 Link to this post

    Excellent, thanks Shinu, that worked perfectly!
  5. Alessandra C
    Alessandra C avatar
    4 posts
    Member since:
    Jan 2010

    Posted 22 Feb 2010 Link to this post

    Sorry for resuming such an old thread but I found a solution that works also for hierarchical grids and maybe can be usefull to someone else :)

     protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)  
            {  
                if ((e.CommandName == RadGrid.EditCommandName) || (e.CommandName == RadGrid.InitInsertCommandName))  
                    e.Item.OwnerTableView.AllowFilteringByColumn = false;  
                else 
                    e.Item.OwnerTableView.AllowFilteringByColumn = true;  
            } 

    Sorry for my bad english, bye

    Alessandra
Back to Top