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

Updating Binding doesn't update control if control has focus

2 Answers 275 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 1
Alan asked on 10 May 2013, 05:19 PM
While the RadNumericUpDown control still has the focus from a previous edit,
if I update what it is bound to in code behind and RaisePropertyChanged for the property,
the RadNumericUpDown does not get updated.

If I first take the focus off of RadNumericUpDown on to another control before changing the bound value in the same way
as above the same RadNumericUpDown does get updated.

Some questions:
  * Is this behavour expected?
  * How can I disable/workaround this?

Below is how I am defining the control and binding in XAML:
<controls:RadNumericUpDown x:Name="XTextBox" Value="{Binding GraphicalItem.Rect.X}" UpdateValueEvent="PropertyChanged" Minimum="{Binding GraphicalItem.Rect.MinX}" Maximum="{Binding GraphicalItem.Rect.MaxX}" LargeChange="{Binding LargeCoordinateChange}" SmallChange="{Binding SmallCoordinateChange}" BorderBrush="#FFCBCBCB" Margin="3,2,0,2" HorizontalAlignment="Right" BorderThickness="1" Background="{x:Null}" Height="20" MinWidth="40" Padding="1,1,2,1"/>


Alan

2 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 15 May 2013, 01:58 PM
Hi Alan,

You mean that the ValueChanged event is not fired?
I have tested in a simple project, in which on a Timer tick I am updating the property bound to the Numeric's value, and it works as expected: the value is updating and the ValueChanged event i fired, but the text is not updated until it looses focus.
Could you please send us a sample project, where this issue can be reproduced? In that way we will be able to debug it locally and find the source of the problem.

Looking forward to your reply.

Kind regards,
Konstantina
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Alan
Top achievements
Rank 1
answered on 15 May 2013, 09:13 PM
I wanted the text to update, even when focus was still on control.
I noticed that you have already given an answer and fix to this here:
http://www.telerik.com/community/forums/wpf/numeric-up-down/ui-value-not-updated.aspx


I tried this and it works for me.
Issue closed!

Thanks,
 Alan
Tags
NumericUpDown
Asked by
Alan
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Alan
Top achievements
Rank 1
Share this question
or