Disable filtering if grid is in edit mode

3 posts, 0 answers
  1. Mircea
    Mircea avatar
    3 posts
    Member since:
    Aug 2018

    Posted 18 Jun Link to this post

    Hello,

    I have a grid that uses "EditForms" to edit a record. What I would like to achieve is to disable filtering while the grid is in edit mode (both for adding a new record or editing an existing one)

    Thank you,

    Marc

     

  2. Mircea
    Mircea avatar
    3 posts
    Member since:
    Aug 2018

    Posted 19 Jun in reply to Mircea Link to this post

    UPDATE:

    I found this code:

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

     

    It works, however... I would like it to work as well when I expand the detail table.

    Please advise.

  3. Mircea
    Mircea avatar
    3 posts
    Member since:
    Aug 2018

    Posted 19 Jun in reply to Mircea Link to this post

    I found a solution that seems to work:

    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.OwnerTableView.Name == "ChildID")
        {
            if (e.Item.Expanded)
                RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)(0).Visible = false;
        }
    }

Back to Top