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

DraggedItemTemplate in Drap and Drop sample?

3 Answers 33 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kjell
Top achievements
Rank 1
Kjell asked on 21 Dec 2010, 08:11 PM
Hi, my question is regarding this demo:

http://demos.telerik.com/silverlight/beta/#GridView/RowReorder


I am using this code pretty much verbatim, and having trouble editing the template for the dragged item.  There is a "DraggedItemTemplate" in the demo but this doesn't seem to be applied anywhere? (same with testTemplate1 & testTemplate1)

How do I edit that template or apply my own template? 

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 22 Dec 2010, 09:10 AM
Hi Kjell,

The template for the dragged item is of type TreeViewDragCue. You may take a look at our online documentation for a reference on the way to customize the template of the drag cue.  

Greetings,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Kjell
Top achievements
Rank 1
answered on 22 Dec 2010, 09:02 PM
Thanks Maya, that link is helpful.

So in the demo is the "ToString()" method of the class being overridden? 
0
Kjell
Top achievements
Rank 1
answered on 22 Dec 2010, 09:49 PM
Ok thanks to that link and some experimentation I was able to get this going.  I want to share my experience just in case it helps anyone else.

First off, overriding ToString() seemed like an easy work around but I found out that wont work for me because I define my class in my web service.

To get a custom template working with the demo code, all I had to do was put the template in App.xaml and add the following lines to the "CreateDragCue" method:

cue.DragActionContentTemplate =

 

App.Current.Resources["DraggedItemTemplate"] as DataTemplate;
cue.ItemTemplate =
App.Current.Resources["DraggedItemTemplate"] as DataTemplate;

 


Tags
GridView
Asked by
Kjell
Top achievements
Rank 1
Answers by
Maya
Telerik team
Kjell
Top achievements
Rank 1
Share this question
or