bind "to" a RadDataForm field

3 posts, 0 answers
  1. Jim
    Jim avatar
    68 posts
    Member since:
    Apr 2011

    Posted 20 Jul 2011 Link to this post

    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. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 20 Jul 2011 Link to this post

    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!

  3. DevCraft banner
  4. Jim
    Jim avatar
    68 posts
    Member since:
    Apr 2011

    Posted 20 Jul 2011 Link to this post

    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
Back to Top