The Clear Filters option in the FieldFilterControl cannot be selected when the DefaultOperator1 is set in the FilterOperatorsLoading event of RadGridView. The FieldFilterControl is the element shown under the column header when the FilteringMode property of RadGridView is set to FilterRow. Setting e.DefaulteOperator1 in the FilterOperatorsLoading properly selects the corresponding filter in the drop down, but after that you cannot select Clear Filters when clicking on this option.
To work this around, you can use the CellLoaded event instead of FilterOperatorsLoading. This will allow you to get the FieldFilterControlViewModel and set its SelectedOperatorViewModel property.
private void manualGridView_CellLoaded(object sender, CellEventArgs e)
{
if (e.Cell is GridViewHeaderCell && e.Cell.Column.UniqueName == "MyColumn")
{
Dispatcher.BeginInvoke(new Action(() =>
{
var fieldFilter = e.Cell.FindChildByType<FieldFilterControl>();
var viewModel = (FieldFilterControlViewModel)fieldFilter.DataContext;
viewModel.SelectedOperatorViewModel = viewModel.AvailableOperatorViewModels.FirstOrDefault(x => x.FilterOperator == FilterOperator.IsLessThan);
}));
}
}
The height of the column footer is not updated properly to autofit the footer's content. Actually, this works when the footer content becomes bigger than the current (or the default) value, but if you change the content with a smaller one, the bigger height remains. In other words, the footer height autofits when the content becomes bigger but it doesn't decrease when the content becomes smaller after that.
To work this around, you can subscribe to the CellLoaded event and use reflection to update one of the internal properties of the panel that draws the footer cells.private void gridView_CellLoaded(object sender, CellEventArgs e)
{
if (e.Cell is GridViewFooterCell)
{
var row = e.Cell.ParentRow;
Dispatcher.BeginInvoke(new Action(() =>
{
var aggregatesList = row.ChildrenOfType<AggregateResultsList>(); // the exact type of children that should be used to get the new height may vary based on your column Footer contents
if (aggregatesList.Count() > 0)
{
var height = aggregatesList.Max(x => x.ActualHeight);
var cellsPanel = e.Cell.ParentOfType<GridViewCellsPanel>();
PropertyInfo minRowHeightProp = cellsPanel.GetType().GetProperty("MinRowHeight", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
object minRowHeightPair = minRowHeightProp.GetValue(cellsPanel);
PropertyInfo heightProp = minRowHeightPair.GetType().GetProperty("Second");
heightProp.SetValue(minRowHeightPair, height);
}
}));
}
}
Currently, when you cancel the Filtering event the field filter (displayed when FilteringMode="FilterRow") will clear any entered text and the funnel icon won't change its color (like when the filter is active). Add an option in the Filtering event, similar to the Sorting event which allows you to manually set the sorting state of the column which will affect the UI (showing and changing the sort indicator icon).
In the case with the Filtering event, there should be an option if the funnel icon should be highlighted. In other words the setting should allow you to manually say if the filter is active or not. Also, the input text in the field filter should be preserved and possible an option to change this value may be added in the event arguments. This will allow you to implement custom filtering and keep the UI state of the field filter.
The column group headers are not displayed when the DisplayIndex property of the GridViewColumn objects is set before the control is loaded.
To work this around, you can set the DisplayIndex of the columns after the RadGridView is loaded.
Empty cells appear when the RadGridView contains many cells in the viewport and the view gets resized.
To work this around you can extract and modify the ControlTemplate of GridViewCell, in order to set the MinHeight property of the "PART_ContentPresenter" element to a number close to the RowHeight of the RadGridView control.
The vertical scrolling seems to become very slow and even unresponsive, when the following conditions are met:
To minimize the issue, you can set the GroupRenderMode property of RadGridView to Nested.
Currently, if RadGridView is bound to a INotifyCollectionChanged collection and the collection class raises the CollectionChanged event with NotifyCollectionChangedAction set to Add, Remove or Insert, RadGridView is not updating its items properly when the OldItems or NewItems collections contain more than 1 items.
Add support for this scenario.