Scale XTickProperties Location Binding

2 posts, 0 answers
  1. Guy
    Guy avatar
    46 posts
    Member since:
    Nov 2008

    Posted 19 Oct 2011 Link to this post

    Hi,

    I am using the 2011 Q2 version.

    Here's a simplified xaml code taken from my solution:

    <telerik:RadialGauge
        <telerik:RadialScale>                               
            <
    telerik:RadialScale.MajorTick>
                <
    telerik:MajorTickProperties
                 Location
    ="{Binding Path=MajorTicksLocation, Converter={StaticResource LocationConverter}}" />
            </telerik:RadialScale.MajorTick>                            
            <
    telerik:RadialScale.MiddleTick>                               
                <
    telerik:MiddleTickProperties
                 Location
    ="{Binding Path=MiddleTicksLocation, Converter={StaticResource LocationConverter}}"/>                              
            </
    telerik:RadialScale.MiddleTick>                              
            <
    telerik:RadialScale.MinorTick>                                   
                <
    telerik:MinorTickProperties
                 Location
    ="{Binding Path=MinorTicksLocation, Converter={StaticResource LocationConverter}}"/>                              
            </
    telerik:RadialScale.MinorTick>                         
        </
    telerik:RadialScale>                  
    </
    telerik:RadialGauge>

    As you can see I am trying to bind the XTickProperties's Location property. I am also using a converter here.
    The problem is that nothing happens when the property in my ViewModel is changed. What's really weird is that
    I use Bindings with Converters on properties of other gauge objects (not shown in the code snippet) such as the Size of the gauge and they work. Moreover, I put a breakpoint  in the Convert method of my converter and it is never reached. Please note that I have successfully done this binding before "programatically".

    I went over this a few times thinking I had a done a stupid mistake somewhere, but before I waste any more time on it I would like
    to confirm with someone that the particular Binding that I'm trying to do is not defective.

    Thank you
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 24 Oct 2011 Link to this post

    Hi Guy,

    This problem occurs because in the current version of the RadGauge data context is not propagated to the objects which represent tick properties (MajorTickProperties, MiddleTickPropeties, MinorTickProperties). It will be changed in the upcoming 2011.Q3 release. For the current version I could suggest following work around: set data context to the tick properties objects from the code. For example:

    public partial class MainPage : UserControl
    {
        private GaugeDataModel dataModel = new GaugeDataModel();
     
        public MainPage()
        {
            InitializeComponent();
     
            this.DataContext = dataModel;
            this.radialScale.MajorTick.DataContext = dataModel;
        }
    }


    Greetings,
    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top