Hi
I've tried to combine the features of the radgrid grouping integration and the sorting and filtering mechanism.
The sorting works fine (except for the fact that I haven't yet managed to perfom sorting when you sort a group header), but the filtering seems a bit more complicated.
I subscribed to the filtered event of the grid, and in code behind, I use the to filteredevent to get the filterdescriptors that were both added and removed from the grid to add or remove them from the Chart
Removing works fine, but if I try add more than one ChartFilterDescriptor, the data won't display anymore, until I reset the filter (ergo removing all the ChartFilterDescriptors)
Is it a normal behaviour ?
ie : The filtering code I'm using
I've tried to combine the features of the radgrid grouping integration and the sorting and filtering mechanism.
The sorting works fine (except for the fact that I haven't yet managed to perfom sorting when you sort a group header), but the filtering seems a bit more complicated.
I subscribed to the filtered event of the grid, and in code behind, I use the to filteredevent to get the filterdescriptors that were both added and removed from the grid to add or remove them from the Chart
Removing works fine, but if I try add more than one ChartFilterDescriptor, the data won't display anymore, until I reset the filter (ergo removing all the ChartFilterDescriptors)
Is it a normal behaviour ?
ie : The filtering code I'm using
void DetailInfo_Filtered(object sender, GridViewFilteredEventArgs e) |
{ |
Queue<ChartFilterDescriptor> filtersToRemove = new Queue<ChartFilterDescriptor>(); |
foreach (ChartFilterDescriptor descriptor in RadChart1.FilterDescriptors) |
{ |
foreach (FilterDescriptor filter in e.Removed) |
{ |
if (descriptor.Value.Equals(filter.Value)) |
filtersToRemove.Enqueue(descriptor); |
} |
} |
foreach (ChartFilterDescriptor descriptor in filtersToRemove) |
RadChart1.FilterDescriptors.Remove(descriptor); |
foreach (FilterDescriptor filter in e.Added) |
{ |
RadChart1.FilterDescriptors.Add(new ChartFilterDescriptor(filter.Member, typeof(string), filter.Operator, filter.Value)); |
} |
} |