This is a migrated thread and some comments may be shown as answers.

Bug Popup won't close

1 Answer 148 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Juan asked on 27 Oct 2008, 04:13 PM
The popup window of the RadDateTimePicker won't close, when the parent is a UserControl hosted by a form from another process.

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:
Write a Microsoft Management Console SnapIn with a UserControl that implements Microsoft.ManagementConsole.IFormViewControl,  containing one very misbehaving RadDateTimePicker.

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').

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!


1 Answer, 1 is accepted

Sort by
Boyko Markov
Telerik team
answered on 31 Oct 2008, 06:35 PM
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.

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.
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Top achievements
Rank 1
Answers by
Boyko Markov
Telerik team
Share this question