Get coordinates of a given RadTreeViewItem

2 posts, 0 answers
  1. Lauren Nickerson
    Lauren Nickerson avatar
    52 posts
    Member since:
    Jul 2009

    Posted 11 Feb 2010 Link to this post

    Hi, I'm trying to figure out how to do this. Is there a method or a property that returns the X and Y coordinates of an item?

    Thanks!

    EDIT:

    I need the coordinates relative to the parent of the RadTreeView and relative to the RadTreeView itself.

    Thanks.
  2. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 12 Feb 2010 Link to this post

    Hello Lauren,

    You can get the corrdinates relative to the parent by using this:

    GeneralTransform generalTransform = childElement.TransformToVisual( parentElement );
    Point childToParentCoordinates = generalTransform.Transform( new Point( 0, 0 ) );


    Alternatively, you can get the absolute coordinates like so:

    GeneralTransform generalTransform = childElement.TransformToVisual( null );
    Point childToParentCoordinates = generalTransform.Transform( new Point( 0, 0 ) );


    Greetings,
    Tihomir Petkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top