I want to drag 3 TextBlock from one user control and want to create textblock with same content in other user control.
So i am adding drag event is different textblocks of first user control and drop events in a grid of second user control.
First time when i am dropping an item it is working fine.
From next item onwards it is showing me arrow line which it has drawn while dropping first item.
My code is:
//UserControl2
private void OnDropInfo(object sender, DragDropEventArgs e)
{
if ( e.Options.Status==DragStatus.DropComplete)
{
//Code for custom processing
}
}
void OnDropQuery(object sender, DragDropQueryEventArgs e)
{
e.QueryResult =
true;
}
//UserControl1
void OnDragInfo(object sender, DragDropEventArgs e)
{
}
protected virtual void OnDragQuery(object sender, DragDropQueryEventArgs e)
{
TextBlock labelItem = e.Options.Source as TextBlock;
e.Options.Payload = labelItem;
ContentControl cue = new ContentControl();
StackPanel spanel = new StackPanel();
spanel.Children.Add(
new TextBlock(){Text =labelItem.Text});
cue.Content =spanel;
e.Options.DragCue = cue;
e.Options.ArrowCue =
RadDragAndDropManager.GenerateArrowCue();
e.QueryResult =
true;
}
Please provide me some sample code to fix this.