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

error with DependencyProperty in indicators

3 Answers 46 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Masoud
Top achievements
Rank 1
Masoud asked on 17 Dec 2014, 03:34 PM
hi to everybody
i tried to use indicators to my project with get help demo telerik
i createing some class .for instance FinancialIndicatorSwitch  and FinancialSeriesTypeSwitch and etc
but when i start i get this error
Error    2    A 'Binding' cannot be used within a 'RadCartesianChart' collection. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.    C:\Users\masoud\Documents\Visual Studio 2013\Projects\exercise_telerik\testchart\testchart\View\indacator.xaml    36    36    testchart

it say problem is in dependencyproperty that define in class and use in view
where this dp use in view in define here
<chart:RadCartesianChart x:Name="RadChart1" Palette="Windows8" Margin="20,0,8,0"
                                   example:FinancialIndicatorSwitch.MainIndicator="{Binding MainIndicator, Mode=TwoWay}"
                                   example:FinancialSeriesTypeSwitch.SeriesType="{Binding SeriesType}"
 
 
and
 
        <chart:RadCartesianChart x:Name="RadChart2" Palette="Windows8" Grid.Row="1" Margin="20,10,8,0"
                                   example:FinancialIndicatorSwitch.SecondaryIndicator="{Binding SecondaryIndicator, Mode=TwoWay}">

i tried to solution this  error but i was unsuccessful 
please help me

3 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 19 Dec 2014, 08:57 AM
Hello Masoud,

I am unsure what the problem is. Are you perhaps setting the attached property to some collection? The stack trace says that you have a collection of charts and you are setting the attached property to that collection.

I am attaching a simple project with a single attached property. Upon setting the attached property, a message box is show. You can write your custom logic in the attached property changed handler. I hope this helps.

Regards,
Petar Marchev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Masoud
Top achievements
Rank 1
answered on 19 Dec 2014, 05:37 PM
hello Petar Marchev
i tried to solution this error but i cant.
i attach my project
this is copy of demo indicator
i remove dll file for volume file was huge
http://uplod.ir/v9cbdk7wf4x8/test.rar.htm

0
Petar Marchev
Telerik team
answered on 23 Dec 2014, 09:19 AM
Hi Masoud,

I was unable to download the project. When I go to the indicated link, I see two gauges and two buttons. Even though I changed the language to English, not much of the content was in English and I didn't see a download button anywhere. I clicked on both of the buttons I see, but still could not download the project.

Have you examined the project I provided? Do you see any differences with your code?

Regards,
Petar Marchev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Chart
Asked by
Masoud
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Masoud
Top achievements
Rank 1
Share this question
or