update binded fields in tileviewItem

2 posts, 0 answers
  1. David
    David avatar
    18 posts
    Member since:
    Dec 2010

    Posted 23 Dec 2010 Link to this post

    I'll try to simplify my problem. Lets say I create a class with a field named "Title". after creating a few objects of this class type. I set a textbox with binding in my TileViews SmallContent :
    <TextBlock  Text="{Binding Title}" />

    and add my objects to the TileView using "tileview1.Items.add()"

    The initial view is good, but now I want to update this value. How do I refer to this field so it will be updated in the TileViewItem? 
    I've tried to change the "Title" value in one of my objects ( which I added using "tileview1.Items.add()" ), but the value in the TextBox doesn't change.

    Bottom line: how do I update a field which is declared in the tileviews dataTemplate?

    Thank you
  2. Petar Mladenov
    Petar Mladenov avatar
    2882 posts

    Posted 28 Dec 2010 Link to this post

    Hi David,

    We prepared a project for you demonstrating how to use the UiElement.ChildrenOfType<> method which allows you to find  elements defined in your datatemplate. On the other hand, in order to view the changes in your ViewModel immediately, your bound fields must use the NotifyPropertyChnaged method of the  INotifyPropertyChanged interface properly. You can inspect how it is achieved in the attached solution and let me know if it fully satisfies you or not.

    Petar Mladenov
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for WPF
  3. DevCraft R3 2016 release webinar banner
Back to Top