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

Miximise TileViewItem 1 & minimise the rest on Load?

6 Answers 102 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Nathi Mfeka
Top achievements
Rank 2
Nathi Mfeka asked on 06 Jan 2010, 08:51 AM
Hi telerik support team

Guys I'm having a problem here, most of the properties on this control are not on your firstlook, but I'm trying to load my first Dashboard(TileViewItem) maximised and the other 4 minimised, currently they all share the space evenly. 

your urgent response will be highly apreciated...

Kind Regards
Nathi

6 Answers, 1 is accepted

Sort by
0
Accepted
Valentin.Stoychev
Telerik team
answered on 07 Jan 2010, 07:11 AM
Hello Nathi Mfeka,

Use RadTileView.MaximizedItem property to set the item you want to be maximised and the rest of the items will go automatically into minimized state.

Kind regards,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Cass
Top achievements
Rank 1
answered on 26 Jan 2010, 10:39 PM
Hi Telerik team,

Is there a way to do this if I am adding additional RadTileViewItems programmatically (they are bound to an ObservableCollection that is increasing)? I want the newly added RadTileViewItem to open in maximized mode.

Thank you,

Cassandra
0
Tihomir Petkov
Telerik team
answered on 27 Jan 2010, 09:24 AM
Hi Cassandra,

Yes, it is possible. However, it depends on your exact case. If your ObservableCollection holds RadTileViewItem objects, you can simply set the TileState property of the newly added tiles to "Maximized". Alternatively, you can set the MaximizedItem of the TileView every time you add a new item to the source collection. Or, you can use ContainerBindings if the ObesrvableCollection holds business objects. As I said, there are several possible approaches that depend on ther scenario.

All the best,
Tihomir Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Cass
Top achievements
Rank 1
answered on 27 Jan 2010, 02:24 PM

Hi Tihomir,

That's very helpful. I think the second option you suggested is the best for my situtation. The ObservableCollection holds Employee objects rather than TileViewItems. I noticed that the newest TileViewItem is always added to the end.

Currently I have:

 

<telerikNavigation:RadTileView x:Name="tileView1" Grid.Row="2" telerik:StyleManager.Theme="Vista" MaxColumns="6" ItemsSource="{Binding Employees, Mode=TwoWay}" MinimizedItemsPosition="Right">

 

 

 

 

I want to add:

 

 

tileView1.MaximizedItem = _______(the last TileViewItem, but I'm not sure how to get this?)
Thank you!

 

0
Tihomir Petkov
Telerik team
answered on 27 Jan 2010, 02:43 PM
Hi Cass,

You can use something like this:
tileView.MaximizedItem = tileView.Items[tileView.Items.Count - 1];

Regards,
Tihomir Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Cass
Top achievements
Rank 1
answered on 27 Jan 2010, 04:19 PM
Oops it looked like inserting the line after adding a new object to the ObservableCollection worked... But at runtime, a RadTileViewItem (probably the one that I had set to maximized) did not seem to have a RadFluidContentControl--triggering an InvalidOperationException "Sequence contains no elements" at the bolded line.

I tried bypassing the line, but it messed up the entire fluidcontentcontrol after several repetitions. The maximized RadTileViewItem also displayed unpredictably (sometimes it would display Normal Content in maximized view, sometimes it would correctly display the Large Content in maximized view)

        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:
                            fluidControl.State = FluidContentControlState.Normal;
                            break;
                    }
                }

            }
        }

Any advice would be much appreciated. Thanks!
Tags
TileView
Asked by
Nathi Mfeka
Top achievements
Rank 2
Answers by
Valentin.Stoychev
Telerik team
Cass
Top achievements
Rank 1
Tihomir Petkov
Telerik team
Share this question
or