Completed
Last Updated: 28 Nov 2014 06:27 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 05 Nov 2014 12:12
Category: GridView
Type: Feature Request
0
ADD. RadGridView - Add AllowAutoScrollOnDragDrop property to stop grid scrolling when the RadDragDropService is working
Workaround:

RadDragDropService dragDropService;
int scrollValue = 0;

public Form1()
{
    InitializeComponent();

    dragDropService = this.leftGrid.GridViewElement.GetService<RadDragDropService>();
    dragDropService.Started += dragDropService_Started;
    leftGrid.TableElement.VScrollBar.ValueChanged += VScrollBar_ValueChanged;
}

private void dragDropService_Started(object sender, EventArgs e)
{
    scrollValue = this.leftGrid.TableElement.VScrollBar.Value;
}

private void VScrollBar_ValueChanged(object sender, EventArgs e)
{
    if (dragDropService != null && dragDropService.State == RadServiceState.Working)
    {
        this.leftGrid.TableElement.VScrollBar.Value = scrollValue; 
    }
}

Resolution: 
Added AllowAutoScrollColumnsWhileDragging and AllowAutoScrollRowsWhileDragging properties of RadGridViewDragDropService: 

RadGridViewDragDropService svc = this.GridViewElement.GetService<RadGridViewDragDropService>();
svc.AllowAutoScrollColumnsWhileDragging = false;
svc.AllowAutoScrollRowsWhileDragging = false;
svc.Start(row);

0 comments