Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

How to proportional space all the children inside a list ?

Closed Thread
 
Thread Tools Display Modes
Old 03-08-2006   #1 (permalink)
Philippe Lavoie
Guest


 

How to proportional space all the children inside a list ?

Hi,

I'm using the Jan CTP and I'd like to evenly space the elements of a
list inside an horizontal box. I do something like


<Style x:Key="TaskList" TargetType="{x:Type ItemsControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ItemsControl}">
<Grid Height="35">
<DockPanel Width="Auto" IsItemsHost="True"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

My problem is that the items always have a constant width. I want them
to fill the Grid.

I also tried to use a DockPanel, but it seems the DocPanel.Dock="Fill"
property is not valid anymore.

Please help

Many thanks

Phil
Old 03-09-2006   #2 (permalink)
Kevin Hoffman
Guest


 

Re: How to proportional space all the children inside a list ?

If you make a Grid's ColumnDefinition have a Width of "*" that will
have that column expand to fill the available space. I haven't tried in
the Feb CTP, but I know in the last one I used, if you have 3 columns
with a Width of *, each column will consume 33% of the available space
provided by the Grid.

That might be what you're looking for.

Old 03-09-2006   #3 (permalink)
Philippe Lavoie
Guest


 

Re: How to proportional space all the children inside a list ?

Kevin Hoffman wrote:
> If you make a Grid's ColumnDefinition have a Width of "*" that will
> have that column expand to fill the available space. I haven't tried in
> the Feb CTP, but I know in the last one I used, if you have 3 columns
> with a Width of *, each column will consume 33% of the available space
> provided by the Grid.
>
> That might be what you're looking for.
>


I wanted a solution which didn't required me to hard code the number of
items I will put inside it. The number of items is unknown at design time.

Thanks

Phil
Old 03-18-2006   #4 (permalink)
Nick Howell
Guest


 

Re: How to proportional space all the children inside a list ?

Have you tried using a style?
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading newsgroup messages coded with plain/text are shown with proportional font Erhard Glueck Live Mail 0 01-10-2008 02:28 AM
change permission on all files inside a folder or hundreds of file inside a folder Anthony B Vista security 2 12-28-2007 04:26 AM
Can not remove one of my contact inside contact list khoosl Vista mail 12 06-16-2007 08:23 AM
Children of the Nile seasider Vista Games 0 03-18-2007 02:34 PM
Those thieving children MICHAEL Vista General 2 12-31-2006 12:58 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50