Hi, I have a rad grid with some custom filters (multi-select drop down boxes). I also have some custom filters which are boolean drop down types. When I use the regular filters and then the custom filter, it will filter by the regular filters, and then filter by the custom filter. But if I use the custom filter first and then any of the other filters, it wipes out all of the filters. I could fix this by not using a filter type of "Custom", but if I use the regular string filtering offered by the rad grid, it does the comparison:
["Column"] Like '%value%'
when what I actually want (since it is a multi-select dropdown, whose filter expression evaluates to String1, String2, String3) is
Value Like '%[Column]%'
Any help is much appreciated:
Here is how I do the custom filtering:
Edit: Would it be a better idea to treat them all as custom and loop through all the columns in the above function and apply all the columns to the predicate and then filter the results?
["Column"] Like '%value%'
when what I actually want (since it is a multi-select dropdown, whose filter expression evaluates to String1, String2, String3) is
Value Like '%[Column]%'
Any help is much appreciated:
Here is how I do the custom filtering:
protected void MarkPickListResultGrid_ItemCommand(object source, GridCommandEventArgs e) { if (e.CommandName == RadGrid.FilterCommandName) { ListResultGrid.MasterTableView.CurrentPageIndex = 0; string columnUniqueName = (e.CommandArgument as Pair).Second.ToString(); GridFilterColumn column = ListResultGrid.MasterTableView.Columns.FindByUniqueNameSafe("Type") as GridFilterColumn; if ((e.CommandArgument as Pair).First.ToString() == "Custom") { List<string> filters = column.CurrentFilterValue.Split(',').ToList(); var predicate = PredicateBuilder.False<PickListMark>(); foreach (string filter in filters) { predicate = predicate.Or(r => filter.Contains(r.MarkType.MarkTypeName)); } ListResultGrid.MasterTableView.DataSource = PickListMark.Where(predicate.Compile()).ToList(); ListResultGrid.MasterTableView.Rebind(); return; } } }Edit: Would it be a better idea to treat them all as custom and loop through all the columns in the above function and apply all the columns to the predicate and then filter the results?
