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

Implementing two way binding for non databound controls

1 Answer 81 Views
Input
This is a migrated thread and some comments may be shown as answers.
Stephen Cossgrove
Top achievements
Rank 1
Stephen Cossgrove asked on 14 Dec 2009, 11:54 PM
Hi

i am currently trying to bind a object property to a RadTextBox and am getting the following error when using the <%# Bind(DataItem.Name) %> method:
System.InvalidOperationException: Databinding methods such as Eval(), XPath(),  
and Bind() can only be used in the context of a databound control. 

I can bind using the following, but it is only one way:
%# DataBinder.Eval(this, "DataItem.Name") %> 

How can i get two way binding?





1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 17 Dec 2009, 10:42 AM
Hello Stephen,

To perform two-way binding you could use this method:
Text='<%# Bind("Name") %>'

For more information, please refer to this help topic:
Two-way declarative binding

Kind regards,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Input
Asked by
Stephen Cossgrove
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or