Paul Evers
Top achievements
Rank 2
Paul Evers
asked on 01 Nov 2011, 10:55 AM
I want to reduce the filteroptions which are presented in the dropdownboxes in the headercontextmenu of a Radgrid. I want to hide options like IsNull, NotIsNull, etc.
How do I do this?
Paul
How do I do this?
Paul
4 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 01 Nov 2011, 11:03 AM
Hello Paul,
Check the following help documentation which explains how to reduce filter menu options.
Reducing the Filter Menu Options.
Thanks,
Princy.
Check the following help documentation which explains how to reduce filter menu options.
Reducing the Filter Menu Options.
Thanks,
Princy.
0
Paul Evers
Top achievements
Rank 2
answered on 01 Nov 2011, 11:09 AM
This does only change the filteroptions in the header. I use the HeaderContextMenu (EnableHeaderContextFilterMenu="True" ). The filteroptions in the dropdowsboxes are not changed with the method you referred to.
Paul
Paul
0
Accepted
Princy
Top achievements
Rank 2
answered on 01 Nov 2011, 02:41 PM
Hello Paul,
You can try the following code snippet to remove IsNull and NotIsNull filter options.
C#:
Thanks,
Princy.
You can try the following code snippet to remove IsNull and NotIsNull filter options.
C#:
protected
void
Page_Load(
object
sender, EventArgs e)
{
RadGrid1.HeaderContextMenu.ItemCreated+=
new
RadMenuEventHandler(HeaderContextMenu_ItemCreated);
}
void
HeaderContextMenu_ItemCreated(
object
sender, RadMenuEventArgs e)
{
foreach
(Control c
in
e.Item.Controls)
{
RadComboBox combo = c
as
RadComboBox;
if
(combo !=
null
)
{
int
itemcount = combo.Items.Count;
int
s = itemcount - 3;
while
(combo.Items.Count > s)
{
combo.Items.Remove(combo.Items.Count - 1);
}
}
}
}
Thanks,
Princy.
0
Paul Evers
Top achievements
Rank 2
answered on 02 Nov 2011, 10:49 AM
Thanks. This works!!
Paul
Paul