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

bind "to" a RadDataForm field

2 Answers 43 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 20 Jul 2011, 09:19 AM
I have a RadDataForm name="RadDataForm1"
that populates with a collection of say Person
It auto generates the fields OK such as
Name
Age
etc
And I can move left and right through the person collection
I want to bind a text box to the Name field and try ...
<TextBox Text="{Binding ElementName=RadDataForm1, Path=Name}" Name="TextBox1" Width="120" />
I see
System.Windows.Data Error: BindingExpression path error: 'Name' property not found on 'Telerik.Windows.Controls.RadDataForm'
Any pointers ?
Thanks
Jim




2 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 20 Jul 2011, 09:24 AM
Hi Jim,

Instead of binding to the RadDataForm , you should bind to the CurrentItem of the RadDataForm .
This should solve the issue.

Regards,
Pavel Pavlov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Jim
Top achievements
Rank 1
answered on 20 Jul 2011, 09:33 AM
Thanks that works, I knew it would be simple but just couldn't get it.
<TextBox Text="{Binding ElementName=RadDataForm1, Path=CurrentItem.Name}" Name="TextBox1" Width="120" />

Regards Jim
Tags
DataForm
Asked by
Jim
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Jim
Top achievements
Rank 1
Share this question
or