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

Help with ArrowCue

5 Answers 100 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
C Bates
Top achievements
Rank 1
C Bates asked on 30 Nov 2009, 02:33 PM
Hello,
I found this article about creating a custom drag arrow: http://www.telerik.com/help/silverlight/raddraganddrop-arrowcue.html
How do I identify the TargetType for the Style element and the ControlTemplate element?  "ns:ArrowCue"?

Thanks for any tips...

5 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 30 Nov 2009, 02:45 PM
Hi C Bates,

The arrow cue can be a simple ContentControl and in this case you will need:

 TargetType  = "ContentCotnrol"

The DragDrop manager actually generates and instance of the DragArrow class, but it is nothing more than a placeholder class:

public class DragArrow : ContentControl
{
    public DragArrow();
}

If you wish to inherit it, then you will need to specify the namespace of the cotnrol which is:

xmlns:dragDrop="clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls"

Then the TargetType will be:

dragDrop:DragArrow

Thanks you for bringing our attention to this, it seems we have not mentioned this in the article.

Kind regards,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
C Bates
Top achievements
Rank 1
answered on 30 Nov 2009, 02:54 PM
Thanks for the quick reply.
My namespace declaration:
xmlns:dragDrop="clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls"

My ControlTemplate:
        <Style x:Key="SlimArrowCue" TargetType="{x:Type dragDrop:DragArrow}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type dragDrop:DragArrow}">

At runtime, however, I get this error:
Additional information: Invalid attribute value {x:Type dragDrop:DragArrow} for property TargetType. [Line: 129 Position: 48]
(Line 129 is the <Style> element.

What am I doing wrong?
Thanks...
-----------------------------------
Arggh...  WPF vs Silverlight in the xaml:
    TargetType="dragDrop:DragArrow"



0
Miroslav
Telerik team
answered on 30 Nov 2009, 03:13 PM
Hi C Bates,

I suppose that you are using Silverlight, since this thread was created in the forum for the Silverlight controls.

The x:Type syntax is not supported in Silverlight, so instead of:

TargetType="{x:Type dragDrop:DragArrow}"

you need to use:

TargetType="dragDrop:DragArrow"

Does this work for you?

Regards,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
C Bates
Top achievements
Rank 1
answered on 30 Nov 2009, 03:15 PM
I have copied the ControlTemplate from the linked article (removing the Image elements).
I assign the template to the Options:
var ac = RadDragAndDropManager.GenerateArrowCue();
                        ac.Template = this.Resources["SlimArrowCue"] as ControlTemplate;
                        e.Options.ArrowCue = ac
...But nothing shows up when dragging. 
What am I missing?

0
Miroslav
Telerik team
answered on 30 Nov 2009, 03:58 PM
Hello C Bates,

I can think of several reasons why this may not work, most probably the event you are trying to handle is already handled by a control (like a TreeView).

I created a sample project where you can see how the DragArrow can be replaced, hopefully you will be able to use it.

If you always want to change the arrow cue, you will be able to reuse the code from the attached project. If you handle the event at root level, it should always replace the arrow.

Sincerely yours,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
DragAndDrop
Asked by
C Bates
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
C Bates
Top achievements
Rank 1
Share this question
or