Skip to main content

Microsoft Silverlight

Answered Question Grid Resizing: Can grid height increase automatically as new components are added to it?RSS Feed

(0)

Whitewing_s
Whitewing_s

Member

Member

198 points

117 Posts

Grid Resizing: Can grid height increase automatically as new components are added to it?

Is it possible in Expression Blend that whenever any component( Grid, textbox, textblock etc. ) is added to a grid, the height increases automatically?

 

Cheers,
Balakrishnan

texmex5
texmex5

Contributor

Contributor

2239 points

382 Posts

Re: Grid Resizing: Can grid height increase automatically as new components are added to it?

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 :)

Whitewing_s
Whitewing_s

Member

Member

198 points

117 Posts

Re: Re: Grid Resizing: Can grid height increase automatically as new components are added to it?

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..

Cheers,
Balakrishnan

Yi-Lun Luo - MSFT
Yi-Lun L...

All-Star

All-Star

25052 points

2,747 Posts

Answered Question

Re: Grid Resizing: Can grid height increase automatically as new components are added to it?

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:

Design Time Resize 

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.

shanaolanxing - I'll transfer to the Windows Azure team, and will have limited time to participate in the Silverlight forum. Apologize if I don't answer your questions in time.

simbuaarumugam
simbuaar...

Participant

Participant

1172 points

405 Posts

Re: Re: Grid Resizing: Can grid height increase automatically as new components are added to it?

 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

SimbuAarumugam India
http://simbusoftwareengineer.blogspot.com
(Mark As Answer If its Satisfy your needs)
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities