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

RadGridView Drag Cue

1 Answer 65 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Kyle
Top achievements
Rank 1
Kyle asked on 17 Nov 2010, 08:20 PM
Hi, 

How can I make the Drag Cue for a RadGridView look like the row I am trying to drag.  I am currently creating my own drag cue with the code below but it does not look as good as the row itself.  Is there a property on the grid to accomplist this?

Code:
if (e.Options.Status == DragStatus.DragInProgress)
{
  ContentControl cue = new ContentControl();
  cue.ContentTemplate = this.Resources["DraggedItemTemplate"] as DataTemplate;
  cue.Content = draggedItem;
  e.Options.DragCue = cue;
}

Markup:
<DataTemplate x:Key="DraggedItemTemplate">
  <StackPanel Orientation="Horizontal" Margin="2" Height="23" Opacity="0.7">
    <StackPanel.Background>
      <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFCEAC4E" Offset="1"/>
        <GradientStop Color="#FFD4B31A"/>
      </LinearGradientBrush>
    </StackPanel.Background>
    <TextBlock Text="{Binding Name}" FontWeight="Bold" Margin="5,3,0,0" />
    <TextBlock Text="{Binding Age}" Foreground="Gray" Margin="10,3,0,0" />
    <TextBlock Text="{Binding Department}" Foreground="Gray" Margin="15,3,0,0" />
    <TextBlock Text="{Binding Salary}" Foreground="Gray" Margin="20,3,0,0" />
  </StackPanel>
</DataTemplate>

Thanks!

1 Answer, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 18 Nov 2010, 10:27 AM
Hello Kyle,

Currently, we are working in providing new drag mode - autodrag which idea is to simplify the process of the drag and drop.

In allows the following:

 - Auto approve drag and drop operation (instead handling dragquery and dropquery)
 - Auto set payload - received from DataContext of the source
 - Auto create dragcue - snapshot of the source UIElement.

This mode will be included in our next latest internal build and will be set through AutoDrag attached property.

Best wishes,
Tsvyatko
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
DragAndDrop
Asked by
Kyle
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Share this question
or