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
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!
Thanks again
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
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 :
RadDragAndDropManager.ExecututionMode = DragExectionMode.Legacy;
The best place to add this line is in App constructor.
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 >>
HI,
I try above solution in my OnDragQuery function
then try in class constracture
RadDragAndDropManager.AddDragQueryHandler( gridEmail, OnDragQuery);
RadDragAndDropManager.AddDragInfoHandler( gridEmail, OnDragInfo);
RadDragAndDropManager.ExecutionMode = DragExecutionMode.Default;
---------------------------------------------------------------------------
RadDragAndDropManager.ExecutionMode = DragExecutionMode.Default;
InitializeComponent();
Thanks,
Gaurang
I solved my problem.
I set RadDragAndDropManager.ExecutionMode = DragExecutionMode.Legacy; property. on both side
Before InitializeComponet();
and inside
OnDragQuery() funciton.
Thanks,
Gaurang
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!
Nik
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Is there any other way to show the arrow without going back to the legacy version of RadDragAndDropManager?
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.
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"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
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
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.
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
I already answered your question in the other forum.
Regards,
Martin Ivanov
Progress Telerik