Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ColumnWidth Property

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 Property ColumnWidth As DataGridLength
<sdk:DataGrid ColumnWidth="dataGridLength"/>

XAML Values


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.


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

© 2015 Microsoft