Esempio n. 1
0
        public void ShowControl(RadDirection popupDirection, int ownerOffset)
		{
			if (this.Visible)
				return;

			bool corected = false;
			Point location = RadPopupHelper.GetValidLocationForDropDown(popupDirection,
				this.Size, this.OwnerElement, ownerOffset, ref corected);

			if (this.grip != null)
			{
				if (corected)
					DockLayoutPanel.SetDock(grip, Telerik.WinControls.Layouts.Dock.Top);		
				else
					DockLayoutPanel.SetDock(grip, Telerik.WinControls.Layouts.Dock.Bottom);		
			}

            this.Location = location;

			this.AutoUpdateBounds();
			if (this.AnimationEnabled)
			{
				this.AnimateDropDown(true);
			}
			else
			{
				this.Show();
			}
        }
Esempio n. 2
0
        public static Point GetValidLocationForDropDown(
            RadDirection popupDirection,
            Size popupSize,
            RadElement owner,
            int ownerOffset,
            ref bool corected)
        {
            Rectangle screenRect = RadPopupHelper.GetScreenRect(owner);
            Rectangle rectangle  = owner.ControlBoundingRectangle;

            if (owner.ElementTree != null)
            {
                rectangle = owner.ElementTree.Control.RectangleToScreen(rectangle);
            }
            return(RadPopupHelper.GetValidLocationForDropDown(popupDirection, screenRect, popupSize, rectangle, ownerOffset, ref corected));
        }