Telerik update - drag arrow disappeared

15 posts, 0 answers
  1. Tracey
    Tracey avatar
    34 posts
    Member since:
    Feb 2011

    Posted 15 Jul 2011 Link to this post

    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

  2. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 15 Jul 2011 Link to this post

    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!

  3. DevCraft banner
  4. Tracey
    Tracey avatar
    34 posts
    Member since:
    Feb 2011

    Posted 15 Jul 2011 Link to this post

    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
  5. Gaurang
    Gaurang avatar
    29 posts
    Member since:
    Dec 2010

    Posted 03 Oct 2011 Link to this post

    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
  6. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 03 Oct 2011 Link to this post

    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 >>

  7. Gaurang
    Gaurang avatar
    29 posts
    Member since:
    Dec 2010

    Posted 03 Oct 2011 Link to this post

    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
  8. Gaurang
    Gaurang avatar
    29 posts
    Member since:
    Dec 2010

    Posted 03 Oct 2011 Link to this post

    Hi,

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

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

    Thanks,
    Gaurang
  9. Kevin
    Kevin avatar
    24 posts
    Member since:
    Apr 2011

    Posted 10 Apr 2012 Link to this post

    what's the modern way to show the arrowcue?
  10. Nick
    Admin
    Nick avatar
    593 posts

    Posted 11 Apr 2012 Link to this post

    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 >>

  11. Rory
    Rory avatar
    159 posts
    Member since:
    Jul 2007

    Posted 14 Sep 2012 Link to this post

    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?
  12. Oscar Wahlen
    Oscar Wahlen avatar
    33 posts
    Member since:
    Mar 2010

    Posted 26 Sep 2012 Link to this post

    I have tried setting the ExecutionMode but the property does not exist (version 2011.3.1116.1040).
  13. Nick
    Admin
    Nick avatar
    593 posts

    Posted 27 Sep 2012 Link to this post

    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.

  14. Oscar Wahlen
    Oscar Wahlen avatar
    33 posts
    Member since:
    Mar 2010

    Posted 01 Oct 2012 Link to this post

    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
  15. Nick
    Admin
    Nick avatar
    593 posts

    Posted 01 Oct 2012 Link to this post

    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.

  16. Oscar Wahlen
    Oscar Wahlen avatar
    33 posts
    Member since:
    Mar 2010

    Posted 01 Oct 2012 Link to this post

    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
Back to Top
DevCraft banner