I had written some code to re-use for each of my grids that sets the filtering functions across my whole project. In the grid I define:
OnInit="RadGridFilter_Init"
protected void RadGridFilter_Init(object sender, EventArgs e)
{
Misc.RadGridFilterOptions(sender, e);
}
This would allow my grids to have the CurrentFilterFunction set for each column and enable autopostback. This worked until we updated to the newest release (1-14-09). Now if I disable the lines that set the autopostbackonfilter to true it will work but otherwise only one column will filter and then any other column's filtering ability is broken.
To re-cap, when I filter the first column as soon as I type in text and hit tab, the column filters the grid correctly. However, as soon as I try to filter another column the gird appears to do an ajax call back but nothing changes. Am I missing something in the newest release or is this a bug. It worked before.
Thanks
OnInit="RadGridFilter_Init"
protected void RadGridFilter_Init(object sender, EventArgs e)
{
Misc.RadGridFilterOptions(sender, e);
}
| public static void RadGridFilterOptions(object sender, EventArgs e) |
| { |
| RadGrid rg = (RadGrid)sender; |
| rg.EnableLinqExpressions = false; |
| rg.GroupingSettings.CaseSensitive = false; |
| //Setting the available filter options |
| GridFilterMenu menu = rg.FilterMenu; |
| for (int i = menu.Items.Count - 1; i >= 0; i--) |
| { |
| 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); |
| } |
| } |
| foreach (GridColumn column in rg.Columns) |
| { |
| if (typeof(System.String) == column.DataType) |
| { |
| column.AutoPostBackOnFilter = true; |
| column.CurrentFilterFunction = GridKnownFunction.Contains; |
| } |
| else |
| { |
| column.AutoPostBackOnFilter = true; |
| column.CurrentFilterFunction = GridKnownFunction.EqualTo; |
| } |
| } |
| } |
To re-cap, when I filter the first column as soon as I type in text and hit tab, the column filters the grid correctly. However, as soon as I try to filter another column the gird appears to do an ajax call back but nothing changes. Am I missing something in the newest release or is this a bug. It worked before.
Thanks