Export (0) Print
Expand All

DataGrid.ColumnWidth Property

Gets or sets the standard width or automatic sizing mode of columns in the control.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.Data (in System.Windows.Controls.Data.dll)

public DataGridLength ColumnWidth { get; set; }
<sdk:DataGrid ColumnWidth="dataGridLength"/>

XAML Values

dataGridLength

An absolute value in pixels, a star sizing, or one of the following constant values: Auto, SizeToCells, SizeToHeaders. For more information, see DataGridLength.

Property Value

Type: System.Windows.Controls.DataGridLength
A structure that represents the standard width or automatic sizing mode of columns in the DataGrid. The default is Auto.

Dependency property identifier field: ColumnWidthProperty

By default, columns will automatically adjust their width to fit their contents. This property affects the width setting of every column in the control that does not have an explicit Width setting.

Version Notes

Silverlight 3: The star sizing feature and using * in XAML are not available for Silverlight 3.

Silverlight

Supported in: 5, 4, 3

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

Community Additions

Show:
© 2014 Microsoft