Issues on DateTimePicker

8 posts, 0 answers
  1. n/a
    n/a avatar
    72 posts
    Member since:
    Jan 2018

    Posted 04 Jul 2019 Link to this post

    We are facing the below issues on DateTimePicker

    1st issue:
    1) Enter the date, month & year.
    2) If we highlight the whole date & update any value, year field is getting changed.
    We need it to update from month date & year if it is fully highlighted.

    2nd issue:
    1) Enter the date, month & year.
    2) If we click "Tab" it is getting focused on the next date time picker. When we go back to the previous datetimepicker it is focussing on the edited year.
    It should focus on month on every datetimepicker.

    Note : If datetimepciker is fully highlighted it should update on MM/DD/YYYY. Demo project & video link attached for your reference. 

    Datetimepicker Working Video

    Demo Project

  2. Dimitar
    Admin
    Dimitar avatar
    2918 posts

    Posted 08 Jul 2019 Link to this post

    Hello Rick,

    1. I was not able to reproduce this on my side (see attached). When I select the entire date and start editing the month is selected. Do I need to do anything specific in this case? 

    2. I was able to reproduce that, you can use the following approach for it:
    Public Sub Datetimetype1(DName As RadDateTimePicker)
       'other code omitted
     
        AddHandler RadDateTimePicker1.DateTimePickerElement.TextBoxElement.TextBoxItem.GotFocus, AddressOf GotFocus
     
    End Sub
     
    Public Sub GotFocus(ByVal sender As Object, ByVal e As EventArgs)
        Dim dtprovider1 As MaskDateTimeProvider = TryCast(Datepickename1.DateTimePickerElement.TextBoxElement.Provider, MaskDateTimeProvider)
        dtprovider1.SelectFirstItem()
     
    End Sub

    I am looking forward to your reply.

    Regards,
    Dimitar
    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.
  3. n/a
    n/a avatar
    72 posts
    Member since:
    Jan 2018

    Posted 12 Jul 2019 in reply to Dimitar Link to this post

    Hello Dimitar,

    Please follow the below steps to reproduce the issue.

    Issue1 : 
    Enter the month, date & year and without clicking anywhere please select the datetimepicker value from right to left, and enter the value it will focus on year.

    Issue 2:
    Thanks it is working fine, on the event which you have given, while running it does not call the autoselectnextpart event. But it should work like without pressing the arrow keys it should go to the next cell.
  4. Dimitar
    Admin
    Dimitar avatar
    2918 posts

    Posted 15 Jul 2019 Link to this post

    Hi Rick,

    1. I was able to reproduce that, but, if I comment the SelectedItemChanged event handler the issue does not occur. Would it be possible to explain the purpose of this code and your exact requirement?

    2. The AutoSelectNextPart is already set in your code and adding the GotFocus event handler is not breaking this behavior on my side. Perhaps you can attach a new project where this is broken? 

    I am looking forward to your reply.

    Regards,
    Dimitar
    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.
  5. n/a
    n/a avatar
    72 posts
    Member since:
    Jan 2018

    Posted 15 Jul 2019 in reply to Dimitar Link to this post

    Hi Dimitar,

    Issue 2:

    Thank you for the suggested solution it is working fine.

    Issue 1:

    The selecteditemchanged event is to stop the AutoSelectNextPart in the year cell. AutoSelectNextPart should be stopped in the year field & should not move further.

    We have used a link for implementing it, link mentioned below for your reference.
    ->   link

    Our requirement, if the cell column is fully highlighted (left-right/right-left, double clicked on the datetimepicker) & if we make any changes, it should start editing from month.

     

  6. Dimitar
    Admin
    Dimitar avatar
    2918 posts

    Posted 16 Jul 2019 Link to this post

    Hello Rick,

    You have to handle these cases separately. I have updated the project and I have added MouseDown and KeyDown event handler which are selecting the first item. 

    I hope this helps. Should you have any other questions, do not hesitate to ask. 

    Regards,
    Dimitar
    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.
  7. n/a
    n/a avatar
    72 posts
    Member since:
    Jan 2018

    Posted 16 Jul 2019 in reply to Dimitar Link to this post

    Hi Dimitar,

    Thanks for the test project. It works but we have a small issue on it. In the test project once we click the datetimepicker it is getting focused on 1st entry (month) but we need an option to select the month/date/year or any of the 2 entries (month & date or date & year).

    Please remove the selection option on month & enable an option for selection based on the user click. If the user clicks near to/on year it should focus on year & same applies to others too.

    We'll share a video link of old application control for your reference.

    Demo video

     

  8. Dimitar
    Admin
    Dimitar avatar
    2918 posts

    Posted 17 Jul 2019 Link to this post

    Hello Rick,

    The mistake is mine, you should check for the SelectionLength in the MouseUp event handler as well:
    Private Sub TextBoxItem_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs)
        Dim item = TryCast(sender, RadTextBoxItem)
        Dim control = TryCast(item.ElementTree.Control, RadDateTimePicker)
     
        Dim dtprovider As MaskDateTimeProvider = TryCast(control.DateTimePickerElement.TextBoxElement.Provider, MaskDateTimeProvider)
     
        If dtprovider.SelectedItemIndex <> 0 And item.SelectionLength > 4 Then
            dtprovider.SelectFirstItem()
     
        End If
    End Sub

    Please let me know if there is something else I can help you with. 
     
    Regards,
    Dimitar
    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.
Back to Top