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
0
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:
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:
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.
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
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.
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
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.
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.