Hi Hieudt,
Thank you for contacting Syncfusion Support.
Query 1: My datetimepicker has custom format set to "dd/MM/yyyy", so I want. when I start edit value, current value will set null.
We were unable to understand your requirement clearly. Please confirm, whether you would like to have no date selected when DateTimePickerAdv is loaded and display DateTime value user Edit on it.
If so, this reported requirement can be resolved by using IsNullDate Property.
Please make use the below Code example:
//DateTimePicker Custom Format
this.dateTimePickerAdv1.CustomFormat = "dd/MM/yyyy";
//Null Value
this.dateTimePickerAdv1.IsNullDate = true; |
Screenshot
Query 2: When I type just (day) or (day & month) it will return full value with current (month & year) or (year)
If this reported requirement is to display the DateTime upon user edit and have Auto Forward to next fields, when user editing on it. If so, please make use the below code snippet:
//set AutoForwarding
this.dateTimePickerAdv1.AutoForwarding = true;
//Edit DateTime
this.dateTimePickerAdv1.NullModeKeyReset = Syncfusion.Windows.Forms.Tools.NullModeKeyReset.Any;
//EnableNullKeys
this.dateTimePickerAdv1.EnableNullKeys = true; |
Screenshot
Editing Date
Editing Month
Figure: If date and month is set then return the full value.
If problem still persist kindly share us more details about this requirement. That would be helpful for us to provide solution at the earliest.
Query 3: When I type day & month & two digits year it will also return full value
As per the standard behavior, it is needed for an end user to provide the number of values as defined in Custom Format. So it is mandatory to type 4 digits in this Year field.
For Example
In Custom Format, you have defined 4 characters to be displayed in Year field. So it is necessary for a user to provide 4 Character input “YYYY”.
We have also prepared the sample and video for your reference, it can be downloaded from the below link,
Kindly check the above solution and let us know if it was helpful or if we have misunderstood your requirement.
Regards,
Mallika