Hi,
I need to create a set of RadMaskedNumericInput dynamically in code. I have the following (working) code with WPF TextBox
var textBox = new TextBox
{
Height = 23,
Width = 40,
Margin = new Thickness(recalculatedPoint.X, recalculatedPoint.Y, 0, 0),
VerticalAlignment = VerticalAlignment.Top,
HorizontalAlignment = HorizontalAlignment.Left
};
Binding bind = new Binding(bindingExpression)
{
Source = this,
Mode = BindingMode.TwoWay,
UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
};
textBox.SetBinding(TextBox.TextProperty, bind);
When I change the control type from TextBox to RadMaskedNumericInput and binding property from TextBox.TextProperty to RadMaskedNumericInput.ValueProperty control is created but binding does not work.The code is:
var textBox = new RadMaskedNumericInput
{
Height = 23,
Width = 40,
Margin = new Thickness(recalculatedPoint.X, recalculatedPoint.Y, 0, 0),
VerticalAlignment = VerticalAlignment.Top,
HorizontalAlignment = HorizontalAlignment.Left
};
Binding bind = new Binding(bindingExpression)
{
Source = this,
Mode = BindingMode.TwoWay,
UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
};
textBox.SetBinding(RadMaskedNumericInput.ValueProperty, bind);
Has anyone an idea why binding does not work?
Thanks in advance.
Have a nice day