I do the following to get a subset of the grid filter options:
This works fine unless you combine it with:
CurrentFilterFunction="EqualTo" (or another option besides Contains).
It appears the grid first sets the index of the current filter function and then removes the filter features with the OnInit command. This puts the wrong item as the default.
I really don't want to have to iterate through each column on every grid I have in the code to set the default. Is this a big or by design? Any quick ways of getting a subset of the filter options and then set the default filter value?
Thanks
protected void RadGridFilter_Init(object sender, System.EventArgs e) |
{ |
RadGrid rg = (RadGrid)sender; |
GridFilterMenu menu = rg.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" || menu.Items[i].Text == "StartsWith") |
{ |
i++; |
} |
else |
{ |
menu.Items.RemoveAt(i); |
} |
} |
} |
This works fine unless you combine it with:
CurrentFilterFunction="EqualTo" (or another option besides Contains).
It appears the grid first sets the index of the current filter function and then removes the filter features with the OnInit command. This puts the wrong item as the default.
I really don't want to have to iterate through each column on every grid I have in the code to set the default. Is this a big or by design? Any quick ways of getting a subset of the filter options and then set the default filter value?
Thanks