How to force TileView to reload its items?

4 posts, 0 answers
  1. Cass
    Cass avatar
    13 posts
    Member since:
    Jan 2010

    Posted 14 Jan 2010 Link to this post

    Hi!

    In the LargeContent view, I have a two-way databinding to objects within an ObservableCollection. Using a debugger, I know that the changes were sucessfully made to the objects. However, when I switch the screen to the NormalContent view, my changes to the objects' datafields are not displaying.

    I think one way to solve the issue is to force TileView to reload its tiles within tileView_TileStateChanged. Is there something I can use to do this?

            private void tileView_TileStateChanged(object sender, Telerik.Windows.RadRoutedEventArgs e)  
            {  
                RadTileViewItem item = e.Source as RadTileViewItem;  
         
                if (item != null)  
                {  
                    RadFluidContentControl fluidControl = item.ChildrenOfType<RadFluidContentControl>().First();  
                    if (fluidControl != null)  
                    {  
                        switch (item.TileState)  
                        {  
                            case TileViewItemState.Maximized:  
                                fluidControl.State = FluidContentControlState.Large;  
                                break;  
                            case TileViewItemState.Minimized:  
                                fluidControl.State = FluidContentControlState.Small;  
                                break;  
                            case TileViewItemState.Restored:  
    //these are things that I have tried, but don't seem to have an effect:---  
                                ObservableCollection<Employee> updatedEmployeeList = myModel.Employees;  
                                this.tileView1.ItemsSource = updatedEmployeeList;  
                                ((RadTileViewItem)e.Source).UpdateLayout();  
    //---  
                                fluidControl.State = FluidContentControlState.Normal;  
                                break;  
                        }  
                    }  
                }  
            } 

    Thanks a lot!
  2. Cass
    Cass avatar
    13 posts
    Member since:
    Jan 2010

    Posted 14 Jan 2010 Link to this post

    Fixed it! Needed to RaisePropertyChanged on individual fields rather than the collection. whoops!
  3. DevCraft banner
  4. Deepak Shakya
    Deepak Shakya avatar
    118 posts
    Member since:
    Aug 2007

    Posted 01 Dec 2010 Link to this post

    Hi Cass,

    I know it has been a while, but could you please let me know how you managed to solve this? I know you raised the PropertyChanged event on individual fields. I have done the same thing but doesn't seem to work. I can see that the binding has worked hence I can display the value in SmallContent but nothing appears in the textbox in the LargeContent.

    I have not implemented the codes after your comment lines. Is this required?

    if possible, could you please send me a snippet of the codes ot a simple example?

    Cheers!
  5. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 06 Dec 2010 Link to this post

    Hi Deepak Shakya,

     Could you please send us a sample project or at least some code snippets, because at the moment I can't figure out where your problem might be? 

    All the best,
    Zarko
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
Back to Top