This is a migrated thread and some comments may be shown as answers.

INotifyPropertyChanged, dependency properties and binding

5 Answers 892 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 04 May 2020, 12:51 PM

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


 

 

5 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 07 May 2020, 08:37 AM

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.
0
Greg
Top achievements
Rank 1
answered on 07 May 2020, 10:30 AM

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

0
Greg
Top achievements
Rank 1
answered on 07 May 2020, 10:32 AM
Somehow the jpg's dissapeared, so Im sending it again.
0
Dinko | Tech Support Engineer
Telerik team
answered on 12 May 2020, 10:30 AM

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.
0
Dinko | Tech Support Engineer
Telerik team
answered on 12 May 2020, 12:11 PM

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.
Tags
ChartView
Asked by
Greg
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Greg
Top achievements
Rank 1
Share this question
or