This question is locked. New answers and comments are not allowed.
v2009.2.812.1030
I have the following code:
It raises NullReferenceException in the "editForm1.DataXontext = detl1" line.
If I move "SequenceNumber" proeprty to WarehouseDetail1 and change binding everything works as expected.
Does RadNumericUpDown support binding to sub properties ?
PS.
Checked the source code, looks like a problem in RadRangeBase.cs line:
I have the following code:
| <UserControl |
| x:Class="TestSilverlightApplication.Page" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:radInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" |
| > |
| <Grid Background="White"> |
| <Grid Name="editForm1" Margin="10" VerticalAlignment="Top"> |
| <Grid.RowDefinitions> |
| <RowDefinition /> |
| </Grid.RowDefinitions> |
| <Grid.ColumnDefinitions> |
| <ColumnDefinition Width="Auto" /> |
| <ColumnDefinition Width="100" /> |
| <ColumnDefinition Width="Auto" /> |
| <ColumnDefinition Width="150" /> |
| </Grid.ColumnDefinitions> |
| <TextBlock Grid.Row="0" Grid.Column="0" Text="Position:" HorizontalAlignment="Right" VerticalAlignment="Center" FontWeight="Bold" Margin="5" /> |
| <radInput:RadNumericUpDown Grid.Row="0" Grid.Column="1" Name="SequenceNumber" Value="{Binding Path=Id.SequenceNumber, Mode=TwoWay}" SmallChange="1" ValueFormat="Numeric" HorizontalContentAlignment="Right" Margin="5" /> |
| <TextBlock Grid.Row="0" Grid.Column="2" Text="Valid Characters:" HorizontalAlignment="Right" VerticalAlignment="Center" FontWeight="Bold" Margin="5" /> |
| <TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Path=ValueCharacters, Mode=TwoWay}" Margin="5" IsEnabled="True" /> |
| </Grid> |
| </Grid> |
| </UserControl> |
| using System; |
| using System.Globalization; |
| namespace TestSilverlightApplication |
| { |
| public partial class Page |
| { |
| public Page() |
| { |
| InitializeComponent(); |
| SequenceNumber.Minimum = Int32.MinValue; |
| SequenceNumber.Maximum = Int32.MaxValue; |
| SequenceNumber.NumberFormatInfo = new NumberFormatInfo { NumberDecimalDigits = 0 }; |
| WarehouseDetail1 detl1 = new WarehouseDetail1 |
| { |
| Id = new WarehouseDetail1Id { SequenceNumber = 1 }, |
| ValueCharacters = "abcd", |
| }; |
| editForm1.DataContext = detl1; |
| } |
| } |
| public class WarehouseDetail1 |
| { |
| public WarehouseDetail1Id Id { get; set; } |
| public string ValueCharacters { get; set; } |
| } |
| public class WarehouseDetail1Id |
| { |
| public int SequenceNumber { get; set; } |
| } |
| } |
It raises NullReferenceException in the "editForm1.DataXontext = detl1" line.
If I move "SequenceNumber" proeprty to WarehouseDetail1 and change binding everything works as expected.
Does RadNumericUpDown support binding to sub properties ?
PS.
Checked the source code, looks like a problem in RadRangeBase.cs line:
| var attributes = classType.GetProperty(bindingExpression.ParentBinding.Path.Path).GetCustomAttributes(typeof(RangeAttribute), false); |