Null data in DateTimePicker
Thank you for contacting Syncfusion Support.
It is possible to apply Null value to the DateTimePickedAdv by using the options below.
Option 1: By enabling IsNullDate property and also set the NullString value as empty in the DateTimePickerAdv. Refer to the below KB link.
KB link: https://www.syncfusion.com/kb/2724/how-to-set-null-value-to-datetimepickeradv
Option 2: By creating a Custom control derived from DateTimePickerAdv and implement a property that helps to hold the Nullable value. You can refer to the below KB article.
KB link: https://www.syncfusion.com/kb/6743/how-to-assign-nullable-value-in-datetimepickeradv
Please confirm whether the given solution works for you. Or else share us more details of the thread/forum which you had mentioned in the last update. It would be helpful to provide a prompt solution.
Regards,
Venkateshwaran V.R.
Hi Venkateshweran, thank you for sharing this ! After implementing, the first option, it works as expected by getting or setting null values. I noticed however that this UI has sometimes a funky reaction, it might be worthwhile to take a look. Sometimes, I try to set a value and when I navigate to other controls (standard WIN textbox & combo), then I notice that either the value is not kept or it resets by itself to a null value.
Meanwhile, I havent tried your 2nd option, but came up with a 3rd option, by the use of ComboDropDown on which I assign a MonthCalendarAdv (https://www.syncfusion.com/kb/1333/is-there-a-way-to-configure-datetimepickeradv-so-that-date-entry-is-consistent-with-the-grid-cell)
DateTImePicker1.PopupControl = MonthCalendarAdv1
DateTmePIcker1.PopupControl.Height = 150
DateTimePicker1.PopupControl.Height = 150
I like the look & feel for this 3rd option, however on this, it seems I cannot pickup the date value, and the width of the calendar seems to be dependent of the control, even if I assign it as shown previously
ComboDropDown1.PopupControl = MonthCalendarAdv1
ComboDropDown1.PopupControl.Height = 150
ComboDropDown1.PopupControl.Height = 150
Thank you! - Nicolas
|
this.comboDropDown1.DropDownWidth = 213; |
- 8 Replies
- 3 Participants
-
NI Nicolas
- Jul 13, 2016 03:59 AM UTC
- Jul 19, 2016 03:58 PM UTC