Unplanned
Last Updated: 28 Jan 2025 16:09 by Martin Ivanov
Martin Ivanov
Created on: 28 Jan 2025 16:09
Category: GridView
Type: Bug Report
1
GridView: The control hangs when resized and frozen columns are enabled (Fluent theme)

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);
    }

 

0 comments