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

How restrict the filter options for sting column in radgrid ?

2 Answers 67 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Purnasekhar
Top achievements
Rank 1
Purnasekhar asked on 14 Mar 2012, 02:37 PM
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 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 Mar 2012, 03:12 PM
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.
0
Purnasekhar
Top achievements
Rank 1
answered on 14 Mar 2012, 04:02 PM
Thank u so much Princy
Tags
Ajax
Asked by
Purnasekhar
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Purnasekhar
Top achievements
Rank 1
Share this question
or