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

3 posts, 1 answers
  1. De
    De avatar
    16 posts
    Member since:
    Aug 2011

    Posted 05 Jun 2014 Link to this post

    With the new DragDropManager (instead of RadDragAndDropManager), how to get the PropertyGridField when mouse is dragging over it?
  2. Answer
    Nick
    Admin
    Nick avatar
    593 posts

    Posted 06 Jun 2014 Link to this post

    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.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. De
    De avatar
    16 posts
    Member since:
    Aug 2011

    Posted 06 Jun 2014 in reply to Nick Link to this post

    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.
Back to Top