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

Need editable option without clicking arrow keys

3 Answers 88 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
jaya
Top achievements
Rank 1
jaya asked on 18 Oct 2018, 02:27 PM
In RadDatetimepicker, need an editable option for all DD/MM/YYYY without clicking any arrow keys. Eg: If I’m once I enter the date it should automatically move to the month and year.

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 19 Oct 2018, 10:36 AM
Hi Jaya,

This is can be achieved by setting the following property:
var provider = radDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider as MaskDateTimeProvider;
provider.AutoSelectNextPart = true;

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
jaya
Top achievements
Rank 1
answered on 23 Nov 2018, 11:52 AM

Hello Dimitar,

Thank you for the suggested solution it works nicely,But the auto selection function should stop on the year & should not move to the day/month field. Please suggest any method.

0
Hristo
Telerik team
answered on 26 Nov 2018, 09:12 AM
Hello Jaya,

You can create a custom MaskDateTimeProvider and override its SelectFirstItem not calling the base implementation: 
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
    public RadForm1()
    {
        InitializeComponent();
 
        this.radDateTimePicker1.Format = DateTimePickerFormat.Custom;
        this.radDateTimePicker1.CustomFormat = "dd/M/yyyy";
         
        MyMaskDateTimeProvider provider = new MyMaskDateTimeProvider(this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.Mask, this.radDateTimePicker1.Culture, this.radDateTimePicker1.DateTimePickerElement.TextBoxElement);
        provider.AutoSelectNextPart = true;
        this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider = provider;
    }
}
 
public class MyMaskDateTimeProvider : MaskDateTimeProvider
{
    public MyMaskDateTimeProvider(string mask, CultureInfo culture, RadMaskedEditBoxElement owner)
        : base(mask, culture, owner)
    {
    }
 
    public override void SelectFirstItem()
    {
        //base.SelectFirstItem();
    }
}

I hope this will help. Let me know if you need further assistance.

Regards,
Hristo
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
jaya
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
jaya
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or