3 Answers, 1 is accepted
0
Hello Tom,
Nikolay Vasilev
the Telerik team
May I ask you to share what you are trying to achieve? A screenshot would be really helpful!
Looking forward to hearing from you!
Nikolay Vasilev
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0

tomas
Top achievements
Rank 1
answered on 25 Apr 2013, 05:37 PM
My bussines object contains some properties and for example the driver property (another class). My so called drivers all already visualized by the treeview. I would like to drag driver from the treeview to the corresponding property of that business object in the RadPropertyGrid.
Is this clear enough?
Nothing special.
I have the problem how to identify the property, where I have dropped dragged data.
Something like destinationItem for a RadTreeView:
How can I find the destination property item? My properties are populated manually.
Thank you very much.
Tom
Is this clear enough?
Nothing special.
I have the problem how to identify the property, where I have dropped dragged data.
Something like destinationItem for a RadTreeView:
private
void
OnDrop(
object
sender, Telerik.Windows.DragDrop.DragEventArgs e)
{
if
(
this
.isTreeSource)
{
var data = DragDropPayloadManager.GetDataFromObject(e.Data,
"DraggedData"
);
this
.sourceItems.Remove(data);
}
if
(e.Effects != DragDropEffects.None)
{
var destinationItem = (e.OriginalSource
as
FrameworkElement).ParentOfType<RadTreeViewItem>();
var dropDetails = DragDropPayloadManager.GetDataFromObject(e.Data,
"DropDetails"
)
as
DropIndicationDetails;
var data = DragDropPayloadManager.GetDataFromObject(e.Data,
"DraggedData"
);
if
(destinationItems !=
null
)
{
int
dropIndex = dropDetails.DropIndex >=
destinationItems.Count ? destinationItems.Count : dropDetails.DropIndex < 0 ? 0 : dropDetails.DropIndex;
this
.destinationItems.Insert(dropIndex, data);
}
}
}
How can I find the destination property item? My properties are populated manually.
Thank you very much.
Tom
0
Hello Tomas,
Nikolay Vasilev
the Telerik team
You can get it by assigning a DropHandler to the Property Grid and get the e.OriginalSource.ParentOfType<PropertyGridField>() item.
Hope this helps!
Nikolay Vasilev
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.