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

Date picker is Delocating from its position

1 Answer 41 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Sandeep Pulkundwar
Top achievements
Rank 1
Sandeep Pulkundwar asked on 29 May 2009, 10:42 AM
Hi,
When i click on the date control to change the date and if i don't select the date and click outside other than calendar, it remains in its position. Even if i click on the Arrow button to close it the calendar dislocates itself to some other postion. This gives a very weird behaviour to the dataTime picker.
Please can you tell me why is this happening or am i missing some property settings for it.

1 Answer, 1 is accepted

Sort by
0
Boyko Markov
Telerik team
answered on 01 Jun 2009, 06:46 AM
Hi Sandeep Pulkundwar,

1.  As far as we understand your case, you are opening the PopUp Calendar. When you click anywhere outside the Calendar area, it does not close and stays opened until you select a date. Could you please confirm that this is your issue? If this is your case please send us a very simple project which demonstrates it or you can send us the steps to reproduce the incorrect behavior.

2. Regarding your second issue with the deallocation of the popup  RadCalendar from RadDateTimePicker, we have prepared a sample workaround:

    2.1. Please subscribe to the LocationChanged event of RadDateTimePicker PopupContro:
   RadDateTimePickerCalendar calendar = this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar;             
   calendar.PopupControl.LocationChanged += new EventHandler(PopupControl_LocationChanged); 

    2.2. In the LocationChanged event handler please modify the Popup Location 

 void PopupControl_LocationChanged(object sender, EventArgs e)  
        {  
            Rectangle screenRectangle = this.radDateTimePicker1.RectangleToScreen(this.radDateTimePicker1.ClientRectangle);  
            RadDateTimePickerCalendar calendar = this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar;  
Point wantedPoint = new Point(screenRectangle.X, screenRectangle.Bottom);  
 
            if (calendar.PopupControl.Location != wantedPoint)  
            {  
                calendar.PopupControl.Location = wantedPoint;  
            }  
        } 

We hope this workaround will help you. We are looking forward to your reply regarding the first issue.

Regards,
Boyko Markov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Sandeep Pulkundwar
Top achievements
Rank 1
Answers by
Boyko Markov
Telerik team
Share this question
or