Grid.ColumnDefinitions Property

Definition

Gets a list of ColumnDefinition objects defined on this instance of Grid.

C#
public ColumnDefinitionCollection ColumnDefinitions { get; }
XAML
<Grid>
  <Grid.ColumnDefinitions>
    oneOrMoreColumnDefinitions
  </Grid.ColumnDefinitions>
</Grid>

Property Value

A list of ColumnDefinition objects defined on this instance of Grid.

Examples

The following example creates a Grid with two columns by using ColumnDefinitions. You can do this using the new succinct syntax or the original syntax - both are accurate and produce the equivalent result. See examples of both below:

Using new succinct syntax:

XAML
<Grid ColumnDefinitions="250,150">
</Grid>

Using the original syntax:

XAML
<Grid.ColumnDefinitions>
    <ColumnDefinition Width="250" />
    <ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>

Applies to

Produkt Verzie
Windows App SDK 0.8, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6

See also