Disabling ScrollViewer Drag Trigger

2 posts, 0 answers
  1. Matan
    Matan avatar
    5 posts
    Member since:
    Aug 2014

    Posted 04 Sep 2014 Link to this post

    Hi !

    I have a RadGridView with attached OnDragInitialize event handler.
    When I try to scroll the gridview's scrollviewer then the event is triggered.
    How may I disable this?

    I've tried this solution:
    public void Rad_OnDragInitialize(object sender, Telerik.Windows.DragDrop.DragInitializeEventArgs e)
                RadGridView itemsControl = (RadGridView)sender;
                ScrollViewer scroll = UIHelpers.GetScrollViewer(itemsControl) as ScrollViewer;
                GridViewVirtualizingPanel presenter = UIHelpers.GetItemsPresenter(itemsControl);
                if (presenter != null && scroll != null && scroll.IsMouseOver && !presenter.IsMouseOver)

    The event isn't triggered anymore but the scrollviewer won't move at all.

  2. Nick
    Nick avatar
    593 posts

    Posted 04 Sep 2014 Link to this post

    Hello Matan,

    You have set AllowDrag to the whole RadGridView instead of just the Rows. You have to set AllowDrag to true on the rows only.
    <Style TargetType="telerik:GridViewRow"
                    <Setter Property="telerik:DragDropManager.AllowDrag"
                            Value="True" />

    This will take care of the problem of ScrollViewer trying to start the drag.

    Hope this makes sense. 

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top