How restrict the filter options for sting column in radgrid ?

3 posts, 0 answers
  1. Purnasekhar
    Purnasekhar avatar
    15 posts
    Member since:
    Jul 2011

    Posted 14 Mar 2012 Link to this post

    Hi All,
    I am using ragdrid with 7 columns,in this grid for name column, i am using filter option(ShowFilterIcon="True"),for this column,if i click on filter option,i am getting 17 filter options.But my requirement is, i want to show only 4 options.
    Is it possible or not ?

    Thanks in advance

    Regards,
    Sekhar.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 14 Mar 2012 Link to this post

    Hello,

    The following code snippet shows how to reduce the filter menu options.
    C#:
    protected void RadGrid1_Init(object sender, System.EventArgs e)
    {
        GridFilterMenu menu = RadGrid1.FilterMenu;
        int i = 0;
        while (i < menu.Items.Count)
        {
            if (menu.Items[i].Text == "NoFilter" || menu.Items[i].Text == "Contains" || menu.Items[i].Text == "EqualTo" || menu.Items[i].Text == "GreaterThan" || menu.Items[i].Text == "LessThan")
            {
                i++;
            }
            else
            {
                menu.Items.RemoveAt(i);
            }
        }
    }

    Thanks,
    Princy.
  3. Purnasekhar
    Purnasekhar avatar
    15 posts
    Member since:
    Jul 2011

    Posted 14 Mar 2012 Link to this post

    Thank u so much Princy
Back to Top