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

Telerik update - drag arrow disappeared

16 Answers 201 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Tracey
Top achievements
Rank 1
Tracey asked on 15 Jul 2011, 01:46 PM
Hi After doing a rad controls update from Visual Studio. My drag arrow has disappeared. I am using the following to generate the arrow:

private void OnDragQuery(object sender, DragDropQueryEventArgs e)
 {
// draw the arrow
if (e.Options.Status == DragStatus.DragQuery)
{
e.QueryResult = true;
e.Handled = true;
var arrowCue = RadDragAndDropManager.GenerateArrowCue();
arrowCue.Background = new SolidColorBrush(ColourFormat.GetColourFromHex("#FFCC0000"));
arrowCue.BorderBrush = new SolidColorBrush(ColourFormat.GetColourFromHex("#FFCC0000"));
e.Options.ArrowCue = arrowCue;
}
 }

Telerik Silverlight VSExtensions   2011.01.414.0
Telerik RadControls for Silverlight VSExtensions Package

16 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 15 Jul 2011, 01:53 PM
Hello Tracey,

First, please excuse us for the inconvenience caused. Please check the information below:

Problem:
Using RadDragAndDropManager Options.ArrowCue does not have any effect and drag cue no longer displays

Cause:
Since Q2 we have introduced new Drag and Drop mechanism through DragDropManager that provides Drag and Drop functionality in cases that RadDragAndDropManager does not work as well as more intuitive API. In order to be backward compatible all RadDragAndDropManager events are raised as usual. However, since DragDropManager does not have build-in arrow cue there is no mechanism to display it.

Solution:
You can enable RadDragAndDropManager legacy mechanism by using RadDragAndDropManager.ExecututionMode :

RadDragAndDropManager.ExecututionMode = DragExectionMode.Legacy;

The best place to add this line is in App constructor.

public App()
{
 RadDragAndDropManager.ExecututionMode = DragExectionMode.Legacy;
}

soon, we will also provide an alternative solution through custom implementation.

Let us know if you have any further questions.

Kind regards,
Tsvyatko
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Tracey
Top achievements
Rank 1
answered on 15 Jul 2011, 02:02 PM
Thank you for your uber speedy reply, much appreciated. I redid the update and that seemd to fix it. If it happens again I will try what you suggest.

Thanks again
0
Gaurang
Top achievements
Rank 1
answered on 03 Oct 2011, 08:56 AM
Hi,

I have same problem. I update my dll then arrow can not see.
<Controls:CrmGridView x:Name="gvEmail" SelectionChanged="gvEmail_SelectionChanged" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"
                                    Margin="0,0,0,0" IsReadOnly="True" ScrollMode="RealTime" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" 
                                    IsFilteringAllowed="False" ShowGroupPanel="False" VerticalGridLinesBrush="Gray" AutoGenerateColumns="False" SelectionMode="Extended" >
                                <gridView:RadGridView.RowStyle>
                                    <Style x:Name="DefaultFontWeight" TargetType="gridElements:GridViewRow">
                                        <Setter Property="dragDrop:RadDragAndDropManager.AllowDrag" Value="True" />
                                    </Style>
                                </gridView:RadGridView.RowStyle>
                                <gridView:RadGridView.AlternateRowStyle>
                                    <Style TargetType="gridElements:GridViewRow">
                                        <Setter Property="dragDrop:RadDragAndDropManager.AllowDrag" Value="True" />
                                    </Style>
                                </gridView:RadGridView.AlternateRowStyle>
</Controls:CrmGridView>
----------------------------------------------------------------------------------------------------------------------------
 
private void OnDragQuery(object sender, DragDropQueryEventArgs e)
        {
 
            if (e.Options.Status == DragStatus.DragQuery)
            {
                e.Options.ArrowCue = RadDragAndDropManager.GenerateArrowCue();
 
                var dataGrid = sender as RadGridView;
 
                var items = dataGrid.SelectedItems.Cast<EmailMessage>().ToList();
 
                e.Options.Payload = items;
 
                var image = new Image()
                {
                    Source = new BitmapImage(new Uri(ImageDB.Email.INVALIDDROP)) //It will show 'x' sign here.
                };
 
                e.Options.DragCue = image;
 
                e.QueryResult = true;
            }
 
            if (e.Options.Status == DragStatus.DropSourceQuery)
            {
                e.QueryResult = true;
                e.Handled = true;
            }
        }

Please reply me. What should I change to show Arrow on drag-drop functionality.

Thanks,
Gaurang
0
Tsvyatko
Telerik team
answered on 03 Oct 2011, 09:12 AM
Hi Gaurang,

 Hove you tried the solution suggested earlier:

"Problem:

Using RadDragAndDropManager Options.ArrowCue does not have any effect and drag cue no longer displays

Cause:
Since Q2 we have introduced new Drag and Drop mechanism through DragDropManager that provides Drag and Drop functionality in cases that RadDragAndDropManager does not work as well as more intuitive API. In order to be backward compatible all RadDragAndDropManager events are raised as usual. However, since DragDropManager does not have build-in arrow cue there is no mechanism to display it.

Solution:
You can enable RadDragAndDropManager legacy mechanism by using RadDragAndDropManager.ExecututionMode :

Copy Code
RadDragAndDropManager.ExecututionMode = DragExectionMode.Legacy;

The best place to add this line is in App constructor.

Copy Code
public App()
{
 RadDragAndDropManager.ExecututionMode = DragExectionMode.Legacy;
}

"

You can also check this help article - http://www.telerik.com/help/silverlight/raddragdropmanager-troubleshooting-drag-arrow-does-not-display.html

Best wishes,
Tsvyatko
the Telerik team

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

0
Gaurang
Top achievements
Rank 1
answered on 03 Oct 2011, 10:16 AM

HI,

I try above solution in my OnDragQuery function

RadDragAndDropManager.ExecututionMode = DragExectionMode.Legacy;

then try in class constracture
RadDragAndDropManager.AddDragQueryHandler( gridEmail, OnDragQuery);
RadDragAndDropManager.AddDragInfoHandler( gridEmail, OnDragInfo);
RadDragAndDropManager.ExecutionMode = DragExecutionMode.Default;
---------------------------------------------------------------------------
RadDragAndDropManager.ExecutionMode = DragExecutionMode.Default;
InitializeComponent();

Thanks,
Gaurang
0
Gaurang
Top achievements
Rank 1
answered on 03 Oct 2011, 01:41 PM
Hi,

I solved my problem.
I set  RadDragAndDropManager.ExecutionMode = DragExecutionMode.Legacy; property. on both side

Before InitializeComponet();
and inside
OnDragQuery() funciton.

Thanks,
Gaurang
0
Kevin
Top achievements
Rank 1
answered on 10 Apr 2012, 08:58 PM
what's the modern way to show the arrowcue?
0
Nick
Telerik team
answered on 11 Apr 2012, 09:39 AM
Hello Kevin,

Still the best way to do this with RadDragAndDropManager is to set the DragExecutionMode to Legacy. You can see how this can be done here.

Hope this helps! 

All the best,
Nik
the Telerik team

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

0
Rory
Top achievements
Rank 1
answered on 14 Sep 2012, 04:02 PM
Hi I am implementing a RadGridView Drag to a RadChart and the arrow is not showing. I found this thread and when implementing LegacyMode I started getting an error: "Set property 'Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.AllowDrag' threw an exception. [Line: 93 Position: 107

Is there any other way to show the arrow without going back to the legacy version of RadDragAndDropManager?
0
Oscar Wahlen
Top achievements
Rank 1
answered on 26 Sep 2012, 08:23 AM
I have tried setting the ExecutionMode but the property does not exist (version 2011.3.1116.1040).
0
Nick
Telerik team
answered on 27 Sep 2012, 11:13 AM
Hello Oscar,

Can you provide some more information about your scenario? The feature is available in the mentioned version. You could be experiencing the problem if the version of the project (Silverlight) is not the same as the version of our assembly. In this case it should be Silverlight 4.

Greetings,
Nik
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Oscar Wahlen
Top achievements
Rank 1
answered on 01 Oct 2012, 11:53 AM
Hello Nik,

Here is an extract of our implementation build against version 2011.3.1116.1040. The project is configured for Silverlight 4 but we have the latest Silverlight runtime installed on the development machine as well (version 5.1.10411.0). I am pretty sure the arrow was visible in an earlier version of RadControls for Silverlight. But now there is only a drag queue and no arrow.

MainPage.xaml

<UserControl x:Class="DragAndDrop.MainPage"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <UserControl.Resources>
        <DataTemplate x:Key="ApplicationDragTemplate">
            <Border Width="50" Height="50" Background="Blue" />
        </DataTemplate>
        <ControlTemplate x:Key="CustomArrowTemplate" TargetType="telerik:DragArrow">
            <Grid Height="30">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Path Height="27" Margin="0,0,-2,0" VerticalAlignment="Bottom" Fill="Black" Stretch="Fill" Data="M0,10 L130,0 L130,25 L0,11.25 z" />
                <Image Height="31" HorizontalAlignment="Left" VerticalAlignment="Center" Width="20" Source="/DragAndDrop;component/Images/pushpin.png" Stretch="Fill" Margin="0,-30,0,0"/>
                <Image Width="70" Height="30" Stretch="Fill" Source="/DragAndDrop;component/Images/pointer.png" Grid.Column="1" HorizontalAlignment="Right"/>
            </Grid>
        </ControlTemplate>
  
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Border Width="100" Height="100" Background="Green" telerik:RadDragAndDropManager.AllowDrag="True" />
        <Border Grid.Column="1" Width="100" Height="100" Background="Orange" telerik:RadDragAndDropManager.AllowDrop="True" />
    </Grid>
</UserControl>

MainPage.xaml.cs

namespace DragAndDrop
{
    using Telerik.Windows.Controls.DragDrop;
  
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
  
            RadDragAndDropManager.AddDragQueryHandler(this, OnDragQuery);
            RadDragAndDropManager.AddDragInfoHandler(this, OnDragInfo);
            RadDragAndDropManager.AddDropQueryHandler(this, OnDropQuery);
            RadDragAndDropManager.AddDropInfoHandler(this, OnDropInfo);
        }
  
        private void OnDropInfo(object sender, DragDropEventArgs e) { }
  
        private void OnDropQuery(object sender, DragDropQueryEventArgs e)
        {
            e.QueryResult = true;
        }
  
        private void OnDragInfo(object sender, DragDropEventArgs e) { }
  
        private void OnDragQuery(object sender, DragDropQueryEventArgs e)
        {
            if (e.Options.Status == DragStatus.DragQuery && e.Options.Source != null)
            {
                ContentControl cue = new ContentControl();
                cue.ContentTemplate = this.Resources["ApplicationDragTemplate"] as DataTemplate;
                e.Options.DragCue = cue;
                var arrowCue = RadDragAndDropManager.GenerateArrowCue();
                arrowCue.Template = this.Resources["CustomArrowTemplate"] as ControlTemplate;
                e.Options.ArrowCue = arrowCue;
            }
            e.QueryResult = true;
        }
    }
}

Oscar
0
Nick
Telerik team
answered on 01 Oct 2012, 02:07 PM
Hello Oscar,

I believe the problem is related to the fact that there isn't specified a Legacy Execution mode for the RadDragAndDropManager. Could you add this line before the InitializeComponent method in your main page? 

RadDragAndDropManager.ExecutionMode = DragExecutionMode.Legacy;


All the best,
Nik
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Oscar Wahlen
Top achievements
Rank 1
answered on 01 Oct 2012, 02:38 PM
Hello again Nik,

I thought the property did not exist but it does. It must have been a typo because the problem is now solved. Thank you for your help.

Oscar
0
Swapnil
Top achievements
Rank 1
answered on 28 Mar 2018, 05:56 PM
How to use arrow cue same as RadDragAndDropManager with DragDropManager  because RadDragAndDropManager got obsolete 
0
Martin Ivanov
Telerik team
answered on 29 Mar 2018, 12:58 PM
Hello Swapnil,

I already answered your question in the other forum.

Regards,
Martin Ivanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
DragAndDrop
Asked by
Tracey
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Tracey
Top achievements
Rank 1
Gaurang
Top achievements
Rank 1
Kevin
Top achievements
Rank 1
Nick
Telerik team
Rory
Top achievements
Rank 1
Oscar Wahlen
Top achievements
Rank 1
Swapnil
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or