Cannot bind to sub property

7 posts, 1 answers
  1. Serhiy
    Serhiy avatar
    9 posts
    Member since:
    Jul 2008

    Posted 14 Oct 2009 Link to this post

    v2009.2.812.1030
    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 { getset; }  
     
            public string ValueCharacters { getset; }  
        }  
     
        public class WarehouseDetail1Id  
        {  
            public int SequenceNumber { getset; }  
        }  
    }  
     

    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); 
  2. Stephane Priolet
    Stephane Priolet avatar
    12 posts
    Member since:
    Mar 2007

    Posted 16 Oct 2009 Link to this post

    Hi,

    I have got exactly the same problem.
  3. DevCraft banner
  4. Answer
    Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 17 Oct 2009 Link to this post

    Hello Stephane Priolet and Serhiy Volhushyn,

    The issue is already resolved in our internal builds. You can expect a working version of this with our next official release that is coming pretty soon. If this is a show stopper for you, I advice you to download our latest internal build that contains major bug fixes and changes. This will also help you prepare your application for our new version and make the adoption curve smoother.

    Thank you for contacting us and we look forward to hearing from you again.

    Sincerely yours,
    Hristo Borisov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Stephane Priolet
    Stephane Priolet avatar
    12 posts
    Member since:
    Mar 2007

    Posted 19 Oct 2009 Link to this post

    Ok, thank you Hristo
  6. Serhiy
    Serhiy avatar
    9 posts
    Member since:
    Jul 2008

    Posted 21 Oct 2009 Link to this post

    Thank you.
     We are trying to migrate to Q3 release and everything looks fine, but the problem is that all Themes besides default one crash application (grids). Because of that we cannot migrate to Q3 beta right now (our product is not released yet, but we have to show a lot of demos and without Office Blue theme it does not look very good).
    Do you know when at least Office Blue theme will be fixed in internal build ?
  7. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 23 Oct 2009 Link to this post

    Hello Serhiy,

    We are not releasing internal builds for the Beta versions since we cannot guarantee the stability of the controls inside. Unfortunately I will not be able to prepare a custom build just for you since there are many modifications that are made constantly and I cannot quickly verify that everything is OK. The official release is scheduled for the first week of November, where all themes will be available, I hope this timeframe is acceptable enough.

    All the best,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Serhiy
    Serhiy avatar
    9 posts
    Member since:
    Jul 2008

    Posted 23 Oct 2009 Link to this post

    Thank you for the response. Beginning of November works perfectly for us.
Back to Top
DevCraft banner