The automatic Position behavior that you describe happens when the popup encounters the edge of the screen. You can check the VerticalOffset of the popup to check whether the popup is positioned above or bellow its target:
verticalOffset = (sender
//the popup is opened bellow its placement target
//the popup is opened above its placement target
The (sender as RadDropDownButton).FindChildByType<Popup>() returns the Telerik Popup control wich is defined in the RadDropDownButton's Controltemplate, whilst its RealPopup property holds the System.Windows.Controls.Primitives.Popup
control on which the Telerik's Popup control is cased on.
Also, since it may take a moment for the popup to update its VerticalOffset
value, it is best to place your logic inside a Dispatcher
in order to make sure that you are working with the updated current values.
I hope that info will help you.
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat
for a walk through all the exciting stuff we ship with the new release!