Completed
Last Updated: 19 Jun 2017 12:30 by ADMIN
ADMIN
Dimitar
Created on: 05 May 2017 09:27
Category: GridView
Type: Bug Report
6
FIX. RadGridView - exception when the grid is not visible and the DPI scaling is larger than 100%
To reproduce:
- Add a grid to a PageView and add the pageView to a dock window at run time.
- The grid should not be visible.
- Set your DPI setting to 150%

Workaround:
class MyViewDefinition : TableViewDefinition
{
    public override IRowView CreateViewUIElement(GridViewInfo viewInfo)
    {
        return new MyTableElement();
    }
}
class MyTableElement : GridTableElement
{
    public override void DpiScaleChanged(SizeF scaleFactor)
    {
        if (this.ViewTemplate != null)
        {
            base.DpiScaleChanged(scaleFactor);
        }

    }
    protected override Type ThemeEffectiveType
    {
        get { return typeof(GridTableElement); }
    }
}

//use the above definition like this:

 radGridView1.ViewDefinition = new MyViewDefinition();
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
8 comments
ADMIN
Stefan
Posted on: 19 Jun 2017 12:30
Hi guys,

the case is resolved in R2 2017 SP1, feel free to upgrade to it in order to take advantage of the fix.
Dan
Posted on: 05 Jun 2017 14:08
Agreed that this is a major bug, and a patch should be released sooner than SP1.  Especially, since high DPI support was touted as a feature in R2 2017.  
Andre
Posted on: 18 May 2017 15:36
when will R2 2017 SP1 be released.
Im trying to decide on a course of action ...roll back or attempt to implement the work around ....which of course will be a waste of time one the patch is released
Jason Parrish
Posted on: 18 May 2017 13:41
When will this be fixed in an internal bug. This is causing issues in several grids and several apps for our team. We are currently planning on just rolling back to the previous version.
Kasim
Posted on: 15 May 2017 11:21
Used code above in GridTableElement class in the Telerik.WinControls.GridView project and it worked all good:
 public override void DpiScaleChanged(SizeF scaleFactor)
        {
            if (this.ViewTemplate != null)
            {
                base.DpiScaleChanged(scaleFactor);

                foreach (GridViewColumn col in this.ViewTemplate.Columns)
                {
                    col.DpiScale = this.DpiScaleFactor;
                }
            }
        }
        protected override Type ThemeEffectiveType
        {
            get { return typeof(GridTableElement); }
        }
Kasim
Posted on: 15 May 2017 10:03
In addition to normal grids, there are a bunch of dynamically generated grids. To implement such a workaround is more difficult in such situations.
Kasim
Posted on: 15 May 2017 10:01

Issue seems to be similar to what we are facing.

The workaround suggested is not feasible as we have a lot of grids in current solution. It's not possible to change the code all over. Testing the solution after the suggested workaround is another big overhead.

Kindly share appropriate patch for the issue.
Martin
Posted on: 09 May 2017 20:37
Referencia a objeto no establecida como instancia de un objeto.

-		TargetSite	{Void DpiScaleChanged(System.Drawing.SizeF)}	System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}


   en Telerik.WinControls.UI.GridTableElement.DpiScaleChanged(SizeF scaleFactor)
   en Telerik.WinControls.RadElement.SetParent(RadElement parent)
   en Telerik.WinControls.RadElement.ChangeCollection(RadElement child, ItemsChangeOperation changeOperation)
   en Telerik.WinControls.RadElementCollection.OnInsertComplete(Int32 index, Object value)
   en System.Collections.CollectionBase.System.Collections.IList.Add(Object value)
   en Telerik.WinControls.UI.RadGridViewElement.SetViewElement()
   en Telerik.WinControls.UI.RadGridViewElement.Template_PropertyChanged(Object sender, PropertyChangedEventArgs e)
   en System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
   en Telerik.WinControls.UI.GridViewTemplate.OnNotifyPropertyChanged(PropertyChangedEventArgs e)
   en Telerik.WinControls.UI.MasterGridViewTemplate.OnNotifyPropertyChanged(PropertyChangedEventArgs e)
   en Telerik.WinControls.UI.GridViewTemplate.set_ViewDefinition(IGridViewDefinition value)
   en Telerik.WinControls.UI.GridViewTemplate.EndInit()
   en Telerik.WinControls.UI.MasterGridViewTemplate.EndInit()