Remove gridfilters generated from code behind

  1. #1

    Remove gridfilters generated from code behind

    Hi,

    I create gridpanels and filters from the code behind as implemented here:

    http://forums.ext.net/showthread.php...sing-HttpProxy

    Once the gridpanel is created, I add it to a tabpanel that is already in my markup

    AddTab(grid, this.tpnlData);

    My problem now is when I try to recreate the grid, with a filter active on the grid, I get an error because somehow the filters don't get cleared properly.
    I already do tpnlData.RemoveAll(true) to make sure that my tpnlData has nothing in it.

    Can you please tell me how to clear the filters before I recreate the gridpanels?

    Thank you.
  2. #2

    Clear the grid filter

    Quote Originally Posted by mkshields9w57 View Post
    Hi,

    I create gridpanels and filters from the code behind as implemented here:

    http://forums.ext.net/showthread.php...sing-HttpProxy

    Once the gridpanel is created, I add it to a tabpanel that is already in my markup

    AddTab(grid, this.tpnlData);

    My problem now is when I try to recreate the grid, with a filter active on the grid, I get an error because somehow the filters don't get cleared properly.
    I already do tpnlData.RemoveAll(true) to make sure that my tpnlData has nothing in it.

    Can you please tell me how to clear the filters before I recreate the gridpanels?

    Thank you.
    Try this...

    private void ClearGridFilters()
    {
    GridFilters grdFilter = grd_PendingSnA.Plugins[0] as GridFilters;
    foreach (GridFilter item in grdFilter.Filters)
    {
    item.SetActive(false);
    }
    }

Similar Threads

  1. [CLOSED] How to add a style to a code behind generated control
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Jun 12, 2012, 5:01 PM
  2. [CLOSED] Code Behind GridFilters
    By BravoTangoOscar in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 25, 2012, 7:52 PM
  3. Replies: 1
    Last Post: Oct 14, 2011, 3:53 PM
  4. Semicolon is missing in generated code
    By hesspet in forum 1.x Help
    Replies: 10
    Last Post: Aug 16, 2011, 3:18 PM
  5. How to remove dynamically generated grid in code behind
    By mkshields9w57 in forum 1.x Help
    Replies: 0
    Last Post: Jul 07, 2011, 12:53 PM

Tags for this Thread

Posting Permissions