Grid.ColumnDefinitions Property

Definition

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

public:
 property ColumnDefinitionCollection ^ ColumnDefinitions { ColumnDefinitionCollection ^ get(); };
ColumnDefinitionCollection ColumnDefinitions();
public ColumnDefinitionCollection ColumnDefinitions { get; }
var columnDefinitionCollection = grid.columnDefinitions;
Public ReadOnly Property ColumnDefinitions As ColumnDefinitionCollection
<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:

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

Using the original syntax:

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

Applies to

See also