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

With the new DragDropManager, how to get the PropertyGridField when mouse is dragging over it?

2 Answers 22 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
De
Top achievements
Rank 1
De asked on 05 Jun 2014, 09:30 PM
With the new DragDropManager (instead of RadDragAndDropManager), how to get the PropertyGridField when mouse is dragging over it?

2 Answers, 1 is accepted

Sort by
0
Accepted
Nick
Telerik team
answered on 06 Jun 2014, 07:41 AM
Hi,

You can use the e.OriginalSource property in combination with the ParentOfType extension method to get the target PropertyGridField.
var field = e.OriginalSource as PropertyGridField ?? (e.OriginalSource as FrameworkElement).ParentOfType<PropertyGridField>();

Hope this helps. 


Regards,
Nik
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
De
Top achievements
Rank 1
answered on 06 Jun 2014, 04:28 PM
It works.  Thanks Nik.  In normal cases the control got passed in as OriginalSource was the border.   Through ParentOfType<PropertyGridField>, it traverses a few levels up to get to the parent PropertyGridField.
Tags
PropertyGrid
Asked by
De
Top achievements
Rank 1
Answers by
Nick
Telerik team
De
Top achievements
Rank 1
Share this question
or