Hi,
We have a RadGridView that uses a custom filter row. When we filter by a value that returns no results the clear the filter or give it a value that should return results, what we get back is an unintelligible set of characters that overwrite each other on a single line. I've included 3 screen shots that capture the results in the grid before filtering, after filtering with a bogus value and after clearing the filter. The 3rd shot is the trash shot. Here is the method where we deal with a change in the filter.
The problem is in the last "else if". We've tried a number of things to get this to work. The if where we check to see if the collection is empty and reload doesn't work. How can we get the grid to display the values it displayed before we added the bogus filter?
Thanks,
Mike
We have a RadGridView that uses a custom filter row. When we filter by a value that returns no results the clear the filter or give it a value that should return results, what we get back is an unintelligible set of characters that overwrite each other on a single line. I've included 3 screen shots that capture the results in the grid before filtering, after filtering with a bogus value and after clearing the filter. The 3rd shot is the trash shot. Here is the method where we deal with a change in the filter.
private void FilterCell_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
var columnHeader = (ColumnFilterCell)sender;
if (e.PropertyName != "IsFilterActive") return;
if (columnHeader.IsFilterActive)
this.radGridView.FilterDescriptors.Add(columnHeader.FilterDescriptor);
else
this.radGridView.FilterDescriptors.Remove(columnHeader.FilterDescriptor);
var be = this.radGridView.GetBindingExpression(RadGridView.ItemsSourceProperty);
var dataItem = be.DataItem;
var path = be.ParentBinding.Path;
if (dataItem == null || path == null) return;
var prop = dataItem.GetType().GetProperty(path.Path);
if (prop == null) return;
var value = prop.GetValue(dataItem, null);
if (value == null) return;
if (value is PagedCollectionView)
{
var pagedCollectionView = value as PagedCollectionView;
pagedCollectionView.Filter = FilterColumn;
pagedCollectionView.Refresh();
}
else if (value is QueryableDomainServiceCollectionView<
Model.Models.CustomJobSetWorkflowTask
>)
{
var collection = value as QueryableDomainServiceCollectionView<
Model.Models.CustomJobSetWorkflowTask
>;
if (collection.IsEmpty) collection.Load();
collection.Refresh();
}
}
The problem is in the last "else if". We've tried a number of things to get this to work. The if where we check to see if the collection is empty and reload doesn't work. How can we get the grid to display the values it displayed before we added the bogus filter?
Thanks,
Mike