Thank you for responding, but that doesn't apply to SILVERLIGHT.
I had previously tried to work that example in Silverlight with no success. Of course, in Silverlight the method MainWindow.OnDragInitialize has to be changed. First, DataObject has no "SetText" method and only "SetData". Further, I receive a security error upon any call to dataobject.SetData. It is my understanding that I need to use "var payload = Telerik.Windows.DragDrop.DragDropPayloadManager.GeneratePayload(null);" and then use payload.SetData(...).
HOWEVER, after much trial and error, I finally figured out how to drag from a RadTreeView [or most other types of control] to a TextBox. The key piece was the Telerik.Windows.DragDrop.DragDropManager.AddDragOverHandler(...)....which didn't exist in the WPF example you referenced.
Essentially, you need to do something like this (sorry I couldn't get format painter to work for me and if Telerik wants to edit my post to fix the formatting that is fine by me):
First, set the TextBox to AllowDrop to True.
...next, the code....
Telerik.Windows.DragDrop.DragDropManager.AddDragInitializeHandler(_radtree, _radtree_OnDragInitialize, true);
private void _radtree_OnDragInitialize(object sender, Telerik.Windows.DragDrop.DragInitializeEventArgs args)
args.AllowedEffects = DragDropEffects.All;
var payload = Telerik.Windows.DragDrop.DragDropPayloadManager.GeneratePayload(null);
payload.SetData(typeof(string), "Text Comming From my treeview");
args.Data = payload;
private void TextBox_OnDragOver(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
e.Effects = DragDropEffects.Copy;
e.Handled = true; // *** Super important, if not specified to true, won't fire drop ***
private void TextBox_OnDrop(object sender, Telerik.Windows.DragDrop.DragEventArgs args)
//Catch drop here
It is noteworthy to point out that I couldn't get the following events to fire when they were hooked up to the textbox (perhaps I use these for the source control -- radtreeview)?