set maximized item

7 posts, 0 answers
  1. joshua odell
    joshua odell avatar
    30 posts
    Member since:
    Sep 2008

    Posted 17 Dec 2009 Link to this post

    How do I set which item is maximized.  I'm databinding the items collection to a list that I get from a WCF call, this list is refreshed every 10 seconds.  What I need to do is get the index of the selected item, so when i rebind I can re select the item at that index.

    I can get the index of the selected item, and in the "TileView_DataContextChanged" event handler I'm doing the following
            private void TileView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) 
            { 
                if(!TileView.Items.IsEmpty) 
                    TileView.MaximizedItem = TileView.Items[Index]; 
            } 


    it sets the maximized item correctly, but that doesn't seem to actually maximize that item.  Am I confused about how this should work?
    I read in the documentation that the RadTileViewItem has a property to change its maximized setting, but I can't find where to get a hold of a reference to that class.

    Thanks

    Joshua
  2. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 18 Dec 2009 Link to this post

    Hello Joshua,

    The property you need to set  is RadTileViewItem.TileState = TileViewItemState.Maximized.
    Let me know if this helps.

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. joshua odell
    joshua odell avatar
    30 posts
    Member since:
    Sep 2008

    Posted 18 Dec 2009 Link to this post

    how do I get a hold of the RadTileViewItem?

    I don't see a list of them in the RadTileView class.  There's an Items collection, but that is just a list of my domain objects that are being bound to.  Where is the list of RadTileViewItems?

    Thanks

    Joshua
  5. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 23 Dec 2009 Link to this post

    Hello Joshua,

    You should use the RadTileView.ItemContainerGenerator.ContainerFromItem() method to get a reference to a RadTileViewItem at runtime. This is due to the fact that when you databind an ItemsControl to a collection of business objects, a wrapping container (RadTileViewItem) is generated on the fly for each one of the source objects. Your DataTemplate specifies how the data in the business objects will be visualized on the screen. Here is an example of how to get a reference to a container:

    RadTileViewItem container = myTileView.ItemContainerGenerator.ContainerFromItem(businessObject) as RadTileViewItem;

    Let me know if this helps.

    Sincerely yours,
    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. Garry Clark
    Garry Clark avatar
    55 posts
    Member since:
    Jan 2005

    Posted 30 Aug 2010 Link to this post

    How can you get/set the RadTileViewItem in a MVVM situation. My situation is similar to Joshua's in that I have a listview that is populated with business objects and when one is selected the RadTileView repopulates its collection from that collection.

    I need to be able to set the RadTileViews maximized item to the one selected from the list, but doing something like this:
    MaximizedItem="{Binding SelectedResident}"
     does not work. 

    Any examples on this?

    Thanks! 
  7. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 02 Sep 2010 Link to this post

    Hi Garry,

    I've prepared a small testing project that demonstrates how to bind RadTileView's MaximizedItem. Have a look at it and let me know if it helps.

    Sincerely yours,
    Kiril Stanoev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Garry Clark
    Garry Clark avatar
    55 posts
    Member since:
    Jan 2005

    Posted 03 Sep 2010 Link to this post

    Kiril,
    Thanks for the example. I had exactly what you had, but I was a knuckle head and forgot to set the Mode=TwoWay. Changed that and it works great!

    MaximizedItem="{Binding SelectedResident, Mode=TwoWay}"

    Again appreciate the help!
Back to Top
UI for WPF is Visual Studio 2017 Ready