Stop the selection

5 posts, 0 answers
  1. Krish
    Krish avatar
    16 posts
    Member since:
    Oct 2018

    Posted 22 Nov 2018 Link to this post

    Hi
      We are using the below code for autoselect next part for the raddatetimepicker. this condition is working good. but we need to stop the selection, once the year is entry is done. please find the below Image. kindly help me to solve this
      
      Thanks in advance
     
     Public Sub Datetimetype(DName As RadDateTimePicker)
            Dim provider = TryCast(DName.DateTimePickerElement.TextBoxElement.Provider, MaskDateTimeProvider)
            provider.AutoSelectNextPart = True
        End Sub

  2. Dimitar
    Admin
    Dimitar avatar
    2808 posts

    Posted 22 Nov 2018 Link to this post

    Hi Krish,

    The image is missing, could you attach it again, please.

    I am not sure what is the desired effect. Do you want to make the year read-only?

    I am looking forward to your reply.
     
    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.
  3. Krish
    Krish avatar
    16 posts
    Member since:
    Oct 2018

    Posted 22 Nov 2018 in reply to Dimitar Link to this post

    hi Dimitar,

        I am very sorry for the inconvenience. I attach the image. For your reference, I attach the video also. Please find the image and video link. sorry once again.

    Video Link: https://Mahaaitech.tinytake.com/sf/MzEwMjAzNl85Mjk4MjM4

  4. Dimitar
    Admin
    Dimitar avatar
    2808 posts

    Posted 23 Nov 2018 Link to this post

    Hi Krish,

    You can use the SelectedItemChanged event of the MaskDateTimeProvider to select the next control. Here is the code:
    Public Sub New()
        InitializeComponent()
        radDateTimePicker1.Format = DateTimePickerFormat.Custom
        radDateTimePicker1.CustomFormat = "dd/MM/yyyy"
     
        Dim dtprovider As MaskDateTimeProvider = TryCast(radDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider, MaskDateTimeProvider)
        dtprovider.AutoSelectNextPart = True
        AddHandler dtprovider.SelectedItemChanged, AddressOf Dtprovider_SelectedItemChanged1
     
     
    End Sub
    Private oldSelectedIndex As Integer = -1
    Private Sub Dtprovider_SelectedItemChanged1(ByVal sender As Object, ByVal e As EventArgs)
        Dim provider = TryCast(sender, MaskDateTimeProvider)
     
        If oldSelectedIndex <> -1 AndAlso oldSelectedIndex = 4 AndAlso provider.SelectedItemIndex = 0 Then
            radTextBox1.Focus()
        End If
        oldSelectedIndex = provider.SelectedItemIndex
    End Sub

    Let me know how this works for you.

    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. Krish
    Krish avatar
    16 posts
    Member since:
    Oct 2018

    Posted 23 Nov 2018 in reply to Dimitar Link to this post

    Thank you so much, Dimitar. code was working good:)
Back to Top