This topic has not yet been rated - Rate this topic

DataGridLengthUnitType Enumeration

Defines constants that describe how DataGrid elements, such as columns, are sized.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.Data (in System.Windows.Controls.Data.dll)
public enum DataGridLengthUnitType
<object property = "enumMemberName"/>

Member name Description
Auto The unit of measure is based on the size of the cells and the column header.
Pixel The unit of measure is expressed in pixels.
SizeToCells The unit of measure is based on the size of the cells.
SizeToHeader The unit of measure is based on the size of the column header.
Star The unit of measure is a weighted proportion of the available space.

This enumeration is used with the UnitType property of a DataGridLength type to indicate how elements are sized relative to other elements in a DataGrid. The DataGridLength type is used for sizing properties, such as DataGrid.ColumnWidth.

In Silverlight 4 and later, the star sizing mode can be used to distribute available space by weighted proportions.

In Extensible Application Markup Language (XAML), star values are expressed as n* where n represents a numeric value. 1* is equivalent to *. For example if two columns in a DataGrid had widths of * and 2*, the first column would receive one portion of the available space and the second column would receive two portions of the available space.

Silverlight

Supported in: 5, 4

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ