This is a migrated thread and some comments may be shown as answers.
set maximized item
6 Answers 125 Views
This is a migrated thread and some comments may be shown as answers.
joshua odell
Top achievements
Rank 1
joshua odell asked on 17 Dec 2009, 05:52 PM
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

6 Answers, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 18 Dec 2009, 07:18 PM
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.
0
joshua odell
Top achievements
Rank 1
answered on 18 Dec 2009, 07:53 PM
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
0
Tihomir Petkov
Telerik team
answered on 23 Dec 2009, 04:13 PM
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.
0
Garry Clark
Top achievements
Rank 1
answered on 31 Aug 2010, 01:59 AM
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! 
0
Kiril Stanoev
Telerik team
answered on 02 Sep 2010, 01:06 PM
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
0
Garry Clark
Top achievements
Rank 1
answered on 04 Sep 2010, 02:05 AM
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!
Asked by
joshua odell
Top achievements
Rank 1
Answers by
Tihomir Petkov
Telerik team
joshua odell
Top achievements
Rank 1
Garry Clark
Top achievements
Rank 1
Kiril Stanoev
Telerik team
Share this question
or