This is a migrated thread and some comments may be shown as answers.

Dragging the tile view via the Header

2 Answers 69 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 13 Aug 2011, 10:49 PM
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 Answers, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 17 Aug 2011, 05:09 PM
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 >>

0
Stephen
Top achievements
Rank 1
answered on 17 Aug 2011, 09:11 PM
Hello Zarko

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

Very much appreciated.
Steve
Tags
TileView
Asked by
Stephen
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Stephen
Top achievements
Rank 1
Share this question
or