NullReferenceException occurs when the the automation peers creation for the rows goes over 10,000 peers (the MaxCachedPeersSize setting of the GridViewDataControlAutomationPeer). The exception occurs only when the 'record' modifier is used in the class definition. For example:
public record class MyClass(int Id)
{
}
The exception stacktrace is:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
peer was null.
Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Automation.Peers.GridViewDataControlAutomationPeer.ClearPeer(Telerik.Windows.Automation.Peers.DataItemAutomationPeer peer) Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Automation.Peers.GridViewDataControlAutomationPeer.GetOrCreateItemPeer(object item, int index) Line 288 C# Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Automation.Peers.GridViewRowAutomationPeer.FindDataItemAutomationPeer(System.Collections.Generic.List<System.Windows.Automation.Peers.AutomationPeer> childPeers) Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Automation.Peers.GridViewRowAutomationPeer.GetChildrenCore()
.
To work this around use the "class" modifier instead of "record". For example, instead of:
public record class MyClass(int Id)
{
}
Use:
public class MyClass
{
public int Id { get; set; }
}
Or alternatively, increase the MaxCachedPeersSize value.
If a RadDocking has its theme set to Windows 11 via the StyleManager.Theme attached property, placing a RadGridView inside (styled with a different theme, such as Office_Black, Summer, etc.) will cause its cells to look merged after performing an edit operation.
As a workaround, the RowHeight and the FontSize properties of the RadGridView instance can be used to resolve this.
The following exception is raised when adding a ColumnGroupDescriptor to the GroupDescriptors property of a RadGridView. This bug is data specific and I've only been able to duplicate it with a large data set but the issue seems like it could be addressed without the actual data, given that the code causing the issue is apparently passing a pixelWidth < 0.
System.ArgumentOutOfRangeException: 'The parameter value must be greater than zero.
Parameter name: pixelWidth'
You are able to resize columns using the columns gripper. The corresponding group will be automatically resized. We can provide a way to resize the column groups. The columns inside the group will be automatically resized with the group.
Exception when resizing column with width set to star and min-width set to 0.
Set the properties to the above and resize a column to 0 and then to the original width -> an exception occurs.
The RadGridView control hangs when the frozen columns are enabled and the application is resized. The exact resizing depends on the screen resolution and the exact new size. This was originally recreated on a monitor with 1600x900 resolution 125% DPI and the application was maximized (resized from restored to full screen size). The issue occurs in the Fluent theme. Also, the FluentPalette.Palette.ScrollBarsMode static property should be set to Normal.
To work this around, you can overrider the MeasureOverride method of RadGridView and add the following code:
public class CustomGridView: RadGridView
{
private static readonly PropertyInfo internalColumnsProp = typeof(GridViewDataControl).GetProperty("InternalColumns", BindingFlags.Instance | BindingFlags.NonPublic);
private static MethodInfo invalidateColumnsMethod;
protected override Size MeasureOverride(Size availableSize)
{
if (EnableRowVirtualization && !double.IsInfinity(availableSize.Height))
{
var internalColumns = internalColumnsProp.GetValue(this);
if (invalidateColumnsMethod == null)
{
invalidateColumnsMethod = internalColumns.GetType().GetMethod("InvalidateColumnWidthsCalculation", BindingFlags.Instance | BindingFlags.NonPublic);
}
invalidateColumnsMethod.Invoke(internalColumns, null);
}
return base.MeasureOverride(availableSize);
}
Currently the filters for the RadGridView only allows 2 filters. It would be very helpful for the default filter popout to have the option to add additional filters.
Current filter popout:
Filter popout with ability to add additional filters via an Add Filter button:
Competitor's GridView controls have this feature already and it would be very useful to have this feature on the RadGridView control.
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);
}));
}
}