.Value being reset on SelectAll

For some reason either invoking .SelectAll() on a CurrencyTextBox or setting TextSelectionOnFocus="true" when setting focus to a CurrencyTextBox resets .Value to 0. Is this behaviour avoidable?

EDIT: Interestingly enough, if I SelectAll() after setting focus to the control, the value's not reset.

3 Replies

VI Vinothini Syncfusion Team November 23, 2017 09:55 AM UTC

Hi Artur, 
 
Thank you for using Syncfusion products. 
 
We have checked the CurrencyTextBox with the SelectAll() method used and  by enabling the TextSelectionOnFocus property. We could find that the CurrencyTextBox retains the value after getting focused. Can you please check with the below given sample. 
 
 
Please let us know whether you have used any other properties, it will be helpful for us to proceed further. 
 
Regards, 
Vinothini.R 



AR Artur November 24, 2017 07:52 PM UTC

The issue must be on how I focus on the CurrencyTB. The project you supplied worked flawlessly. When I selected the CurrencyTextBox, its contents were successfully selected. However to focus on the CurrencyTB I am currently using an OnKeyDown even on the previous TextBox:


        private void SfTextBoxExt_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
                currencytb.Focus();
        }

Focusing on currencytb in that fashion does reproduce the situation I'm having. It's worth noting that if I use a standard WPF TextBox, it works with no issues.
Currently using VS 2017 64-bit and using the latest version of the Essentials (15.4.0.17).

Attachment: TextBoxWpf_8d22076.rar


KJ Keerthana Jegannathan Syncfusion Team November 27, 2017 12:08 PM UTC

Hi Artur, 
 
We considered this issue “Value resets to zero while shifting focus using enter key in CurrencyTextBox” as bug and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates. 
 
 
Regards, 
 
Keerthana J 


Loader.
Up arrow icon