How can I find real position of RadDiagramShape in the screen?

Mahmut

Hi,
I try to find real position of shape. Position object in the shape doesn't provide it. I think you have a kind of position mechanism. I have a shape object, and I get diagram object by using the shape object.
I tried

DiagramExtensions.GetTransformedPoint(diagram,shape.Position);

,but it return same value.

And I tried this

var parent = ParentFinder.GetAncestor<RadDiagram>(shape);

var transformedPoint = shape.TransformToAncestor(parent)

.Transform(newPoint(0, 0));

but it return different value.
Actually I try to show popup which is positioned to shape object. I can try to position to Content, but then drag or selection operation handled by shape object.
How can I find real position of RadDiagramShape in the screen? or How can I show a popup according to position of the shape object.

Thanks in advance.

Pavel R. Pavlov

You can take advantage of the ItemInformationAdorner.AdditionalContent property. It is of type object and you can visualize anything in it. Please note that this content is visualized when a shape is selected. An example of its usage is the SettingsPane extension control.

The only concern about this property may be the fact that it is shared among all shapes.

Mahmut

Hi Pavel,
Thanks for your answer. Like you said, InformationAdorner is shown, when item is selected. I want to show TextBlock for all items. TextBlock visibility and text changes according to some inputs. In addition, each item has different text property and format. If I put TextBlock in content of shape, then Connector margin will be changed( Connector must be placed with reference to my custom shape ). If I defined custom connectors, I must define for all format. So I must know How can I place a UIElement with reference to RadDiagramShape.

Pavel R. Pavlov

As far as I understand you need to show a separate TextBlock for all shapes. What I do not understand is why you want to host all those UI Elements outside the RadDiagram framework. This will require you to manually reposition all popups on every user interaction. This will most probably drop the overall performance of your application. This is why we highly recommend to you to reconsider your requirements and concrete implementation. There should be a better way to implement your scenario using our components only. There is no need you to manually position every one TextBlock that you need to host.

Please provide us with detailed information about your scenario and we will try to think of a better approach for you to implement. The more detailed the information is the more accurate the suggested approach will be. Everything regarding your scenario and requirements (e.g. pictures, mockups, videos, snippets...) may be of help.

Mahmut

Hi,
thanks for your response. Yes you are right, so I try to many things to handle this in RadDiagram Framework, but I couldn't. How can I solve this in the framework?. Actually I try to create a kind of InformationAdorner. There is only one difference, it will be active for all items, not only selected items.

Pavel R. Pavlov

Since you need to always show any information regarding each one of the shapes all the time, why don't you try hosting that information in the Content of the RadDiagramShape? I still cannot see any meaningful reason which forces you to visualize that particular information in separate UI Element outside our RadDiagram Framework. The best way to approach this issue is to host the information inside the shape itself.

Moreover, if you need to host that information outside our control this requirement goes beyond our support services since it does not concern any issues related to our controls. Finding the physical position of any UI Element rendered on your screen is a general programming question and we suggest looking for an answer in other community driven online resources (like StackOverflow).

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.