DragAndDrop from RadGridView - tooltip appears when trying to scroll

4 posts, 0 answers
  1. Aleksander
    Aleksander avatar
    2 posts
    Member since:
    Dec 2010

    Posted 17 Aug 2011 Link to this post

    Hey, on RadGridView with scrollbars and DragAndDrop query/info - when I try to scroll - Drag tooltip appears (OnDragQuery) preventing normal scrolling.

    e.Options.Source is RadGridView, how to filter scrollbars out of DragDrop when scrolling content of RadGridView?

    Thanks,
    Alex
  2. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 18 Aug 2011 Link to this post

    Hi Aleksander,

     You might want to check this help article - http://www.telerik.com/help/wpf/raddraganddrop-disable-drag-when-scrolling.html.

     Let us know if you have any further question or issues regarding this scenario.

    Best wishes,
    Tsvyatko
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Aleksander
    Aleksander avatar
    2 posts
    Member since:
    Dec 2010

    Posted 18 Aug 2011 Link to this post

    Unfortunately, this solution doesn't work.

    e.GetElement<System.Windows.Controls.Primitives.ScrollBar>(e.Options.MouseClickPoint)

    is always returning null for RadGridView in OnDragQuery

    I wrote a workaround myself:

    private bool IsScrollBarHit(Visual reference, Point pt)
            {
                var htr = VisualTreeHelper.HitTest(reference, pt);
                var parent = htr.VisualHit;
                while(parent != null && !parent.GetType().Equals(typeof(System.Windows.Controls.Primitives.ScrollBar)))
                {
                    parent = VisualTreeHelper.GetParent(parent);
                }
                return parent != null;
            }

    and use it in OnDragQuery as:
    var pt = YOURRADGRIDVIEW
                    .TransformToAncestor(YOURMAINWINDOW)
                    .Transform(new Point(0, 0));

                var relPoint = new Point(e.Options.MouseClickPoint.X - pt.X, e.Options.MouseClickPoint.Y - pt.Y);

    if (IsScrollBarHit(YOURRADGRIDVIEW, relPoint))

    {
    e.QueryResult = false;
    return;
    }

    //if (e.GetElement<System.Windows.Controls.Primitives.ScrollBar>(e.Options.MouseClickPoint) != null)
    //{
    //    e.QueryResult = false;
    //    return;
    //}

    Please check your e.GetElement<T> if it works correctly with RadGridView
    Alex
  5. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 23 Aug 2011 Link to this post

    Hi Aleksander,

     Thank you for sharing this. We will definitively check our code for any issues. Would it be possible to share with us any specifics of the scenario in which the problem occurs - Using element hosts, main window styles applied or popups used.

    Kind regards,
    Tsvyatko
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top