Windows Vista Forums

How to proportional space all the children inside a list ?

  1. #1


    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

      My System SpecsSystem Spec

  2. #2


    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.


      My System SpecsSystem Spec

  3. #3


    Nick Howell Guest

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

    Have you tried using a style?

      My System SpecsSystem Spec

How to proportional space all the children inside a list ?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get a list of files that does not contain certain text inside the NiklasEngfelt PowerShell 1 12 Jan 2010
Reading newsgroup messages coded with plain/text are shown with proportional font Erhard Glueck Live Mail 0 10 Jan 2008
change permission on all files inside a folder or hundreds of file inside a folder Anthony B Vista security 2 28 Dec 2007
Can not remove one of my contact inside contact list khoosl Vista mail 12 16 Jun 2007
Those thieving children MICHAEL Vista General 2 31 Dec 2006