properties that you can use. When you open RadContextMenu
via code by setting IsOpen=true
, you have two options to control the position where the Popup will be:
1) Set PlacementTarget
property - for example you can set it to the current shape and RadContexMenu will be shown below it.
2) Handle one of the mouse events on the control and set PlacementRectangle
property. In order to get the position of the mouse, you'll need one of the mouse events (MouseLeftButtonDown, MouseLeftButtonUp, etc). In the event handler you can use the code below:
Point mousePosition = e.GetPosition(
Rect(mousePosition.X, mousePosition.Y, 0, 0);
This will open the ContextMenu right below the mouse (as the PlacementRectangle
has width=0 and height=0).
I'm sending you a sample project to demonstrate this approach. Could you check it and inform us in case you have any problems or concerns.
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>