Ticket T620181
Visible to All Users

DateEdit Vista Calendar press Today button should close the popup

created 7 years ago (modified 7 years ago)

Hi,

i use the DateEdit with Vista calendar. I know there is no "today" button visible, only at the top of the popup is a button with the current date. If i press on this current date button, i would like that the popup closes and the current date is in the editor. Same behaviour like the clear button. If i press this, the popup is closed and the editor is cleared. Can you build this with the today-button too?

Another solution would be a short cut key for the today date. i read that it should be possible to press space, but this is not working…

Thank you

Nico

Answers approved by DevExpress Support

created 7 years ago (modified 7 years ago)

Hello Nico,
You can handle the editor's Popup event and subscribe a handler to the today button's Click event:

C#
private void DateEdit1_Popup(object sender, EventArgs e) { PopupDateEditForm popupForm = ((sender as IPopupControl).PopupWindow as PopupDateEditForm); popupForm.Calendar.TodayClick += Calendar_TodayClick; } private void Calendar_TodayClick(object sender, EventArgs e) { PopupCalendarControl calendar = (PopupCalendarControl)sender; PopupDateEditForm form = (PopupDateEditForm)calendar.FindForm(); form.OwnerEdit.EditValue = DateTime.Now; form.ClosePopup(); }

Let me know if this solution is helpful.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.