Hi,
I am using a tile control bound to an ObservableCollection, each item of which contains another ObservableCollection which is displayed as the content of the tile. When I add something to one of these lists in the list expands, then a scrollbar will appear on the tile, but the tile will remain the same size. When I pick the tile up and drop it again in exactly the same place, then it will resize to display the full list. Is there a way I can programmatically force it to resize the tile when I make the change to the list, so that I never see the scrollbars?
Thanks,
Rich
Rich,
I created the attached sample based on our online help documents. It declares several data templates for the various states of the tiles...binding to the DataUtil class.
I added a button that adds some Products in the Beverage Category. Strangely, I am not even seeing the new Products in the Tiles control even though they are in memory. I will follow up with our engineers to see if something is amiss with the control. IN the mean time, can you either provide a sample, or modify my sample to demonstrate the issue you describe?
Thanks,Francis
Hi Francis,
Thanks for the reply and the sample.
I spotted the problem with adding the extra products - they were being added to the overall product list, not product list in the category. I've modified the sample slightly to fix this and demonstrate my problem.
What I'm attempting to do is have the tiles resize in the 'Normal' state, so I've added the list to the normal item template. You can see what happens when you click 'Add Beverage' after start up. You won't see the new beverages appear. Then pick up the beverage tile and let it go again. It suddenly resizes and you can see the new beverages. I'd like to know if I can programmatically force the resizing, without waiting for some user interaction.
It notice that the resizing works automatically when the tile is in the 'minimizedExpanded' mode. I'm not sure if I should be using that instead, but I don't want to have a maximised tile, so this doesn't seem to quite fit either.
One of our developers had a look at the sample and agrees this looks like a bug. Therefore, I've logged the issue in Development with ref number 42855.
As a work around, you could put the following code after the point where the ItemsSource is updated (i.e., at the end of the click event in the sample):
TilesPanel tilesPanel = Infragistics.Windows.Utilities.GetDescendantFromType<TilesPanel>(this.xamTilesControl1, true, null); tilesPanel.InvalidateMeasure();
You will be notified when this fix is released.
That work around does the trick. Thanks very much.
I did notice another minor bug once I'd put it in though. When you have a tile that is bigger than the window then you get a vertical scrollbar, as you'd expect. If you scroll by grabbing the scroll bar then it is fine. However, if you scroll up and down using the mouse wheel then the window scrolls, but the scrollbar doesn't move. It's not a big problem, but I thought it might be worth mentioning.
Cheers,