Focus stays on right hand side instead of being on left hand side

3 posts, 1 answers
  1. Bharat Mendapara
    Bharat Mendapara avatar
    18 posts
    Member since:
    Sep 2013

    Posted 20 Mar 2014 Link to this post

    I have a RadMaskedDateTimeInput for DateTime where I am displaying Time. Now when I click on inbuilt Clear Button, the focus stays on right most side.
    Is there a way to get focus on left most side, as it was in the previous version (2013.2.724.40), but my current installed version is  2013.3.1204.40.
    Any help will be much more appreciated.

    Thanks
  2. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 24 Mar 2014 Link to this post

    Hello Bharat,

    You have hit a bug in our RadMaskedDateTimeInput. After pressing clear the caret should be placed in the first position. We logged this it in our FeedBack portal where you can track its status and we also updated your telerik account points. The bug will be probably included in Q1 2014 SP next month.

    As a workaround, you can inherit the RadMaskedDateTimeInput and override the OnSelectionOnFocus method like so:
    /// <summary>
           /// Determines the new SelectionStart position.
           /// </summary>
           protected override int OnSelectionOnFocus(SelectionOnFocus selectionOnFocus)
           {
               // Position 0 must be the default SelectionStart because typing starts from left to right.
               if (selectionOnFocus == SelectionOnFocus.Default)
               {
                   return 0;
               }
               return base.OnSelectionOnFocus(selectionOnFocus);
           }


    Regards,
    Petar Mladenov
    Telerik
     

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Bharat Mendapara
    Bharat Mendapara avatar
    18 posts
    Member since:
    Sep 2013

    Posted 24 Mar 2014 in reply to Petar Mladenov Link to this post

    Hi Petar Mladenov,

    Thanks for providing the solution.
    I solved this problem by creating custom RadMaskedDateTimeInput control and override the OnSelectionOnFocus method.

    Thanks
    Bharat Mendapara
Back to Top