Dragging the tile view via the Header

3 posts, 0 answers
  1. Stephen
    Stephen avatar
    12 posts
    Member since:
    Jul 2010

    Posted 13 Aug 2011 Link to this post

    Creating a DragQuery method for setting the drag cue only seems to work when dragging the contents. When dragging the header the drag image is alway the TileViewItem itself. This method is called but has no effect.

           private void TileViewDragQuery(object sender, DragDropQueryEventArgs e)
            {
                try
                {
                    if (e.Options.Status == DragStatus.DragQuery)
                    {
                        e.QueryResult = true;
                        e.Handled = true;


                        e.Options.Payload = sender as FrameworkElement;
                        e.Options.ArrowCue = RadDragAndDropManager.GenerateArrowCue();


                        // Create Drag Cue
                        // Create a ContentControl. It will be used as a DragCue.
                        ContentControl dragCue = new ContentControl();
                        // Use a DataTemplate to "say" how the dragged item will be displayed.
                        dragCue.ContentTemplate = mainGrid.Resources["DragCueTemplate"] as DataTemplate;
                        e.Options.DragCue = dragCue;
                    }
                    else if (e.Options.Status == DragStatus.DropSourceQuery)
                    {
                        e.QueryResult = true;
                        e.Handled = true;
                    }
                }
                catch (Exception)
                {
                    throw;
                }
            }


  2. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 17 Aug 2011 Link to this post

    Hello Stephen,
    That's because when you're dragging the header of an item the RadTileView itself creates a DragQuery and sets the drag cue. You can try to stop this by setting the IsItemDraggingEnabled property to false.
    If you have more questions feel free to ask.

    Greetings,
    Zarko
    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. Stephen
    Stephen avatar
    12 posts
    Member since:
    Jul 2010

    Posted 17 Aug 2011 Link to this post

    Hello Zarko

    Your solution worked perfectly. Many thanks for your help and quick response.

    Very much appreciated.
    Steve
Back to Top