How To find the location of any treeviewitem in silverlight

Posted by user312772 on Stack Overflow See other posts from Stack Overflow or by user312772
Published on 2010-04-09T12:53:18Z Indexed on 2010/04/11 21:23 UTC
Read the original article Hit count: 522

Filed under:
|
|

Hi I am new in silverlight 3. I want to find the location of any treeview Item . Although I applied this code

GeneralTransform gt = ProjectTree.TransformToVisual(Application.Current.RootVisual as UIElement);
Point offset = gt.Transform(new Point(0, 0));

double controlTop = offset.Y;
double controlLeft = offset.X;

Here Project tree is the root element of the treeview. This code is working But when I applied this for any child TreeViewelement of Treeview then an exception occurs "Value does not fall within the expected range." How to find the location of this child treeview element object

© Stack Overflow or respective owner

Related posts about silverlight-3.0

Related posts about .NET