Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit Grid Resizing: Can grid height increase automatically as new components are added to it?
4 replies. Latest Post by simbuaarumugam on August 29, 2008.
(0)
Whitewing_s
Member
198 points
117 Posts
08-27-2008 4:38 AM |
Is it possible in Expression Blend that whenever any component( Grid, textbox, textblock etc. ) is added to a grid, the height increases automatically?
texmex5
Contributor
2239 points
382 Posts
08-27-2008 5:14 AM |
The height of what?
Just incase:
The grid can have dynamic height, width:
<Grid.RowDefinitions>
<RowDefinition Height="0.3*"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
the 0.3* means 30% of the height the grid has
30 means 30 pixels
hope this helps :)
08-27-2008 5:46 AM |
Hi,
Say that the height of the layoutroot is 480.. I tried to embed 5 grids each of height 150 stacked vertically( i.e in each row of the base grid).. Going by this 1 grid will lie outside the layoutroot.. My question is that how i can accomodate the 5th grid in layout root...?
In this context can u have a grid resized in height according to the number of components added to it.
I think giving * for row definition only divides the space within the grid according to the percentage..
What i need is to resize the height of the grid as i add components to it..
Yi-Lun L...
All-Star
25052 points
2,747 Posts
08-29-2008 2:25 AM |
Hello, generally speaking, you should avoid setting explicit size on Grid. If you remove the Width="something" and Height="something", the Grid will automatically adjust its size. This, however, may cause some problems in design time. So you can use the Design Time Size feature, which doesn't affect runtime. Have a look at this screenshot:
The markup generated looks like this:
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="247" d:DesignHeight="236"
Note the d:DesignWidth/Height properties. They don't affect runtime. As long as your Grid doesn't have Width/Height property, it will automatically resized along with the browser.
simbuaar...
Participant
1172 points
405 Posts
08-29-2008 2:42 AM |
sure you will achieve your requirements by using story board .. when you added new Textblock or textbox etc .. must write storyboad
in that stroyboard metion
grid row definition column definition where we can place user controls