Completed
Last Updated: 19 Oct 2015 14:07 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 03 Sep 2015 11:23
Category: Panorama
Type: Bug Report
0
FIX. RadPanorama - horizontal scrollbar does not move when dragging a tile to the last/first group and the form is maximized
To reproduce:

1.Open Demo Hub example and maximize the form.
2.Start dragging "Maginifier" tile.
3. Try to drop it to the last group. You will notice that horizontal scrollbar does not move when the form is maximized. However, it behaves as expected if the form is not maximized.

Workaround:
public Form1()
{
    InitializeComponent();

    this.radPanorama1.PanoramaElement.DragDropService = new CustomService(this.radPanorama1.PanoramaElement);
}

public class CustomService : TileDragDropService
{
    public RadPanoramaElement OwnerElement { get; set; }

    public CustomService(RadPanoramaElement owner) : base(owner)
    {
        OwnerElement = owner;
    }

    public int ScrollStep
    { 
        get
        {
            return (int)typeof(TileDragDropService).GetField("scrollStep",
                System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(this);
        }
        set
        {
            typeof(TileDragDropService).GetField("scrollStep",
                System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).SetValue(this, value);
        }
    }

    protected override void HandleMouseMove(Point mousePos)
    {
        Point clientPoint = OwnerElement.PointFromScreen(mousePos);
        Timer scrollTimer = typeof(TileDragDropService).GetField("scrollTimer",
            System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(this) as Timer;
        if (clientPoint.X > this.OwnerElement.Size.Width - 5)
        {
            ScrollStep = (clientPoint.X - this.OwnerElement.Size.Width) + 5;
            if (!scrollTimer.Enabled)
            {
                scrollTimer.Start();
            }
        }
        else if (clientPoint.X < 5)
        {
            ScrollStep = clientPoint.X - 5;
            if (!scrollTimer.Enabled)
            {
                scrollTimer.Start();
            }
        }
        else
        {
            base.HandleMouseMove(mousePos);
        }
    }
}
0 comments