Bug Popup won't close

2 posts, 0 answers
  1. Juan
    Juan avatar
    2 posts
    Member since:
    Oct 2008

    Posted 27 Oct 2008 Link to this post

    The popup window of the RadDateTimePicker won't close, when the parent is a UserControl hosted by a form from another process.

    Symptoms:
    No matter how much you click the Calendar popup window, the drop-down button, press ESC, or change active window, the popup window refuses to close.
    Pressing and holding down Left Ctrl+Left Shift+Left Alt+Right Ctrl+Right Alt+Right Shift+F5+Scroll Lock, will not close the popup window either.

    How to reproduce, in three ultra-easy super-duper simple steps:
    1) 
    Write a Microsoft Management Console SnapIn with a UserControl that implements Microsoft.ManagementConsole.IFormViewControl,  containing one very misbehaving RadDateTimePicker.

    2) 
    Run (you must first create a new management console file (.msc) with a reference to your new SnapIn, which was created in the first of the three ultra-easy super-duper simple steps, then set the path to that file as 'Startup parameter' and set mmc.exe as 'Start External Program').

    3) 
    Click the dropdown button in the errant RadDateTimePicker. The popup is correctly displayed. Selecting a date in the popup will update the edit box, but the popup window will not close.  

    I have attempted to subscibe to the Calendar.SelectionChanged event and call the PopupControl.HideControl() as described in some previous post, but to no avail.

    Calls to PopupControl.HideControl() will -not- close the popup window.
    Calling PopupControl.HideControl() really often will -not- close the popup window.

    I believe there is something spooky going on inside PopupControl.HideControl() or one of the methods that it calls that doesn't work in this scenario.

    Oh, standard .NET ComboBox works fine.

    Please advice!

    Regard,
    Juan
  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 31 Oct 2008 Link to this post

    Hi Juan,

    You are right. The way to hide the popup control is:

    (this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar).PopupControl.HideControl();

    If HideControl doesn't work in your specific scenario, I can suggest you to call the Hide method or use the Visible property. PopupControl is just a bit more extended standard Control. So what works for a standard control as a properties will work for the popup control, too.

    Note:
    In Windows Forms all controls have to be accessed from a single thread and we cannot guarantee that our contorls are thread-safe just as standard controls are not. Interprocess communication is even harder. We cannot help you further on that.   

    Please do not hesitate to contact us if you have more questions.

     
    All the best,
    Boyko Markov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top