Mike
http://www.eikospartners.com
6 Answers, 1 is accepted
You could use the Left and Top properties of the RadWindow control - they set its absolute position. In order to find out what is the absolute position of the button, you could use its TransformToVisual method - it returns a transformation and you can use it to transform a new point. Here is an example:
var point = button.TransformToVisual(
null
).Transform(
new
Point(0, 0));
window.Left = point.X;
window.Top = point.Y;
Hope this helps.
Regards,Miroslav Nedyalkov
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.
Mike
http://www.eikospartners.com
P.S. It would be a nice feature if there was a RelativeLeft and ReleativeTop, only to make it easier for Designers who usually work with XAML with minimal code-behind.
Thank you for your suggestion, but unfortunately this is not a straight-forward task.
If we add such properties there are a lot of questions to answered in order to implement them. First of all we need to know relative to whom should be this position. Another problem is when we need to update the Left and Right properties using the relative values. For example - in your case you need to have relative coordinates from a button - imagine that this button moves - because of the layout or because of a RenderTransform. It is very complicated to determine when we should update the position.
Because of these problems we proffered to the user of the RadWindow control to implement this in the manner he/she prefers to do that.
Sincerely yours,Miroslav Nedyalkov
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.
Mike
http://www.eikospartners.com
My environment : Silverlight with MVVM design pattern
The solution that you have suggested takes care of initial location of radwindow with respect to a button. But this solution fails in 2 scenarios :
1 - after the radwindow is launched, manually if it is moved to a differnet location and closed, on next launch, it does not open relative to the button instead it opens at the place where it was manually dragged
2 - How can I keep the location of radwindow ALWAYS relative to the button even when the browser window is resized ?
Waiting to hear from you !
~ Anjani !
As I mentioned before this is not a built-in feature of the RadWindow control, but a custom code that solves a custom problem. Currently we don't have an example of what you want to achieve as it is not easy to do it for all the cases. If you know all the scenarios when this button would be moved you could just update the window's location when any of these events occurs.
Hope this helps.
Miroslav Nedyalkov
the Telerik team