Completed
Last Updated: 10 Nov 2014 09:39 by ADMIN
ADMIN
George
Created on: 01 Oct 2014 09:23
Category: Editors
Type: Bug Report
0
FIX. RadAutoCompleteBox - When the AutoCompleteBox is on the first screen and a part of it is on the second sometimes the dropdown does not display correctly
Add a RadAutoCompleteBox with some data source and dock it to top of the Form.

Start the Application and stretch the form to the second screen. Autocomplete some items, you will notice that the dropdown will not be shown on the correct position. Also at some point when you are reaching the end of the first screen it will be displayed on the seconds screen.

Workaround:

(this.AutoCompleteBox.TextBoxElement as RadAutoCompleteBoxElement).AutoCompleteDropDown.PopupOpening += AutoCompleteDropDown_PopupOpening;

....

void AutoCompleteDropDown_PopupOpening(object sender, CancelEventArgs args)
{
    var e = args as RadPopupOpeningEventArgs;
    var popup = sender as RadTextBoxAutoCompleteDropDown;
    bool isOnTwoScreens = false;
    if (this.Location.X < Screen.PrimaryScreen.WorkingArea.Width && this.Location.X + this.Width > Screen.PrimaryScreen.WorkingArea.Width)
    {
        isOnTwoScreens = true;
    }

    if (popup.Width + e.CustomLocation.X > Screen.PrimaryScreen.WorkingArea.Width && isOnTwoScreens)
    {
        e.CustomLocation = new Point(e.CustomLocation.X - Screen.PrimaryScreen.WorkingArea.Width, e.CustomLocation.Y);
    }
}
0 comments