Skip to main content
Home Forums Silverlight Programming Report a Silverlight Bug TabControl not sizing as expected, causes contents to have bizarre sizing behavior
1 replies. Latest Post by CoderX on October 2, 2008.
(0)
CoderX
Member
154 points
89 Posts
10-01-2008 8:48 PM |
I have a TabControl that is contained within a grid cell. This TabControl contains a grid in each of it's two tabs. Those internal grids contain DataGrids and other things. The desired behavior is for the TabControl to fill the dimensions of its container grid cell. I can not get it to do this. In Beta2, it at least would size properly to it's contents. Now it does not, and the internal grids (which contain grid splitters) show very bizarre sizing behavior. The internal grids have columns defined with * widths.. which should force the TabControl to take as much space as possible... but they don't. When I use the grid splitters all sorts of weird sizing jumps occur.. it's very strange. TabControl unfortunately does not recognize * as a valid width attribute either.
I had high hopes that the RC0 version of the TabControl would be ready to go, but it seems that we've traded some bugs for others. The "make everything inside them smaller" bugs are gone, but this new layout bug is a real head-scratcher. Barring a fix, I'll have to go back to using buttons and collapsing to get proper behavior.
I can post a screen-cast if someone needs to see it in action.
10-02-2008 1:58 PM |
Ok, I found my problem.
VerticalAlignment and HorizontalAlignment were the culprits. I had set these to Top and Left respectively which mostly worked in B2, but in RC0 is gives the behavior of squishing everything as much as possible. Once I removed these attributes the tab control nicely filled the grid cell and I am most happy. So if you see this behavior check those attributes and make sure they are set correctly.
I must say that overall I'm very impressed with the latest build.. it's looking pretty good.