Unplanned
Last Updated: 26 Jun 2018 09:31 by ADMIN
ADMIN
Dimitar
Created on: 01 Jun 2018 05:34
Category: GridView
Type: Bug Report
1
FIX. RadGridView - the column chooser is incorrectly scaled when moving between monitor with different DPI scaling
Use attached to reproduce.
- Use a 125% and 150% monitor for reproducing.
- This should be tested on Windows 10 1803 (Spring Update) as well.

Workaround:
private void RadGridView1_ColumnChooserCreated(object sender, Telerik.WinControls.UI.ColumnChooserCreatedEventArgs e)
{
    e.ColumnChooser = new MyColumnChooser(this.radGridView1.MasterTemplate, radGridView1.GridViewElement);
}

public partial class MyColumnChooser : GridViewColumnChooser
{
    public MyColumnChooser()
    {
        InitializeComponent();
    }
    public MyColumnChooser(GridViewTemplate template, RadGridViewElement rootElement) : base(template, rootElement)
    {
    }
    SizeF oldDpi = new SizeF(1, 1);
    protected override void HandleDpiChanged()
    {

        base.HandleDpiChanged();
        SizeF descale = new SizeF(1f / this.FormElement.DpiScaleFactor.Width, 1f / this.FormElement.DpiScaleFactor.Height);
        this.Scale(descale);
        var dpi = NativeMethods.GetMonitorDpi(Screen.FromRectangle(this.Bounds), NativeMethods.DpiType.Effective);
        if (oldDpi != dpi)
        {
            SizeF sz = new SizeF(dpi.Width / oldDpi.Width, dpi.Height / oldDpi.Height);
       
            this.Scale(dpi);
        }

        oldDpi = dpi;
    }
   
}
Attached Files:
0 comments