Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

Difference between "Auto" & "*" (star) while setting Wi... RSS

2 replies

Last post Dec 22, 2008 07:01 AM by jay nanavati

(0)
  • jay nanavati

    jay nanavati

    Contributor

    3517 Points

    668 Posts

    Difference between "Auto" & "*" (star) while setting Width property of control.

    Dec 22, 2008 06:21 AM | LINK

    I want to learn difference between "Auto" & "*" (star) while setting Width property of control. For example, say setting Width of Grid row.

  • Patrick8639

    Patrick8639

    Contributor

    2261 Points

    476 Posts

    Re: Difference between "Auto" & "*" (star) while setting Width property of control.

    Dec 22, 2008 06:55 AM | LINK

    Jay,

    • Auto: the cell size is the size of its content.
    • *: the cell size is a percentage of the "remaining size" of its content.The remaining size is the size of the grid, minus the fixed and auto size. This remaining size is divided in the * rows or columns, proportionaly of the values before *.

    You can have more information in the entry GridLength, in the SDK definition:

    XAML Values

    doubleValue

    The row's height, or column's width, expressed as a floating-point value for a pixel count. Typically this is specified as an integer, although interpolation of floating-point values is supported by grid layout.

    starSizing

    A convention by which you can size rows or columns to take the remaining available space in a Grid. A star sizing always includes the asterisk character (*), and optionally precedes the asterisk with an integer value that specifies a weighted factor versus other possible star sizings (for example, 3*). For more information about star sizing, see Grid.

    Auto

    The column's width, or the row's height, described by the literal Auto. For more information about Auto sizing, see Grid.

     

    Patrick

  • jay nanavati

    jay nanavati

    Contributor

    3517 Points

    668 Posts

    Re: Re: Difference between "Auto" & "*" (star) while setting Width proper...

    Dec 22, 2008 07:01 AM | LINK

     Thanks Patrick8639.