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

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

2 Answers 26 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Bharat Mendapara
Top achievements
Rank 1
Bharat Mendapara asked on 20 Mar 2014, 06:10 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 24 Mar 2014, 10:06 AM
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.

 
0
Bharat Mendapara
Top achievements
Rank 1
answered on 24 Mar 2014, 12:04 PM
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
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Bharat Mendapara
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Bharat Mendapara
Top achievements
Rank 1
Share this question
or