Miximise TileViewItem 1 & minimise the rest on Load?

7 posts, 1 answers
  1. Nathi Mfeka
    Nathi Mfeka avatar
    16 posts
    Member since:
    Aug 2009

    Posted 06 Jan 2010 Link to this post

    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
  2. Answer
    Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 07 Jan 2010 Link to this post

    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.
  3. DevCraft banner
  4. Cass
    Cass avatar
    13 posts
    Member since:
    Jan 2010

    Posted 26 Jan 2010 Link to this post

    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
  5. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 27 Jan 2010 Link to this post

    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.
  6. Cass
    Cass avatar
    13 posts
    Member since:
    Jan 2010

    Posted 27 Jan 2010 Link to this post

    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!

     

  7. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 27 Jan 2010 Link to this post

    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.
  8. Cass
    Cass avatar
    13 posts
    Member since:
    Jan 2010

    Posted 27 Jan 2010 Link to this post

    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!
Back to Top
DevCraft banner