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

RadRichTextBox in DataTemplate - DataProvider binding does not work

1 Answer 42 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Dmitry
Top achievements
Rank 1
Dmitry asked on 03 Jul 2014, 03:58 PM
Hello!

I have a RadRichTextBox inside a DataTemplate, and I have HtmlDataProvider inside RadRichTextBox.Resources section bound to it. But for some reason this does not work, error message is:
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=RichTextBox'. BindingExpression:(no path); DataItem=null; target element is 'HtmlDataProvider' (Name=''); target property is 'RichTextBox' (type 'RadRichTextBox')


I can bind provider with radrichtextbox after both controls are initialized, but I want to do that in XAML.
Is there a way to accomplish this task?

(Also I could not attach sample project, because only image files are allowed)...

1 Answer, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 08 Jul 2014, 10:58 AM
Hi Dmitry,

Please move the data provider in the visual tree, rather than in the resources of RadRichTextBox as this is most likely the cause of the observed issue. If this does not help please open a support ticket and send us the project, so that we can look into it on our end.

Let me know how it goes.

Regards,
Petya
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
RichTextBox
Asked by
Dmitry
Top achievements
Rank 1
Answers by
Petya
Telerik team
Share this question
or