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

How to force TileView to reload its items?

3 Answers 110 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Cass
Top achievements
Rank 1
Cass asked on 14 Jan 2010, 04:31 PM
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!

3 Answers, 1 is accepted

Sort by
0
Cass
Top achievements
Rank 1
answered on 14 Jan 2010, 09:16 PM
Fixed it! Needed to RaisePropertyChanged on individual fields rather than the collection. whoops!
0
Deepak Shakya
Top achievements
Rank 1
answered on 02 Dec 2010, 02:41 AM
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!
0
Zarko
Telerik team
answered on 06 Dec 2010, 06:22 PM
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
Tags
TileView
Asked by
Cass
Top achievements
Rank 1
Answers by
Cass
Top achievements
Rank 1
Deepak Shakya
Top achievements
Rank 1
Zarko
Telerik team
Share this question
or