INotifyPropertyChanged, dependency properties and binding

6 posts, 0 answers
  1. Greg
    Greg avatar
    3 posts
    Member since:
    Apr 2020

    Posted 04 May Link to this post

    Hi!

    I am trying to create a radar chart, which axis values would change after value update.

     

    <telerik:CategoricalDataPoint Category="A" Value="{Binding Path=BoundNumber, Mode=TwoWay}"/>
    <telerik:CategoricalDataPoint Category="B" Value="70"/>
    <telerik:CategoricalDataPoint Category="C" Value="70"/>

     

    I can't bind the value this way, because I get this error:

    'Binding' cannot be set on the 'Value' property of type 'CategoricalDataPoint'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.

     

    What's the solution?

     

    Thanks in advance for your help.

     

    Best regard,

    Grzegorz Kaczmarczyk


     

     

  2. Dinko
    Admin
    Dinko avatar
    1144 posts

    Posted 07 May Link to this post

    Hello Greg,

    Thank you for the information.

    To make your scenario work, you need to bind the ItemsSource of the series to a business object. Then to update a data point, you need to update the properties of this business object. You can take a look at the Create Data-Bound Chart help article in our documentation, which describes how you can bind the chart.

    Give this article a try and let me know if further assistance is required.

    Regards,
    Dinko
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
  3. Greg
    Greg avatar
    3 posts
    Member since:
    Apr 2020

    Posted 07 May in reply to Dinko Link to this post

    Hi!

    Thank you for your answer.

    I've read the article about data binding, but I have problem with implementing it in my case.

    I am gathering values of three variables by this code:

     

    private int _pierwszaWartosc;<br>
            public int PierwszaWartosc<br>
            {<br>
                get { return _pierwszaWartosc; }<br>
                set<br>
                {<br>
                    if (_pierwszaWartosc != value)<br>
                    {<br>
                        _pierwszaWartosc = value;<br>
                        OnPropertyChanged("PierwszaWartosc"); <br>
                    }<br>
                }<br>
            }<br>
    <br>
            private int _drugaWartosc;<br>
            public int DrugaWartosc<br>
            {<br>
                get { return _drugaWartosc; }<br>
                set<br>
                {<br>
                    if (_drugaWartosc != value)<br>
                    {<br>
                        _drugaWartosc = value;<br>
                        OnPropertyChanged("DrugaWartosc");<br>
    <br>
                    }<br>
                }<br>
            }<br>
    <br>
            private int _trzeciaWartosc;<br>
            public int TrzeciaWartosc<br>
            {<br>
                get { return _trzeciaWartosc; }<br>
                set<br>
                {<br>
                    if (_trzeciaWartosc != value)<br>
                    {<br>
                        _trzeciaWartosc = value;<br>
                        OnPropertyChanged("TrzeciaWartosc");<br>
    <br>
                    }<br>
                }<br>
            }

     

    How can I create a series from these variables? I think this is the last puzzle piece I need...

    I also attached the files with code in jpg.

     

    Thanks in advance.

     

    Best regards,

    Grzegorz Kaczmarczyk

  4. Greg
    Greg avatar
    3 posts
    Member since:
    Apr 2020

    Posted 07 May in reply to Greg Link to this post

    Somehow the jpg's dissapeared, so Im sending it again.
  5. Dinko
    Admin
    Dinko avatar
    1144 posts

    Posted 12 May Link to this post

    Hi Greg,

    Thank you for the provided image.

    I will prepare a sample project for you and I will contact you again by the end of the day.

    Regards,
    Dinko
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
  6. Dinko
    Admin
    Dinko avatar
    1144 posts

    Posted 12 May Link to this post

    Hello Greg,

    Thank you for your patience.

    Let me first start with that the RadarAreaSeries requires for its Category and Value properties string and digit type values. In the provided code snippet, there are 3 properties of type integer and I will assume that you have three data points that you want to show in the PolarChart. What you can do is to create one business object and just change the value of the digit property. 

    You can find a sample project attached to this reply.

    Regards,
    Dinko
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top