Skip to main content
.NET Framework Class Library
DataGridLength Structure

Represents the lengths of elements within the DataGrid control.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
Syntax
<[%$TOPIC/cc645135_en-us_VS_110_2_0_0_0_0%](GetType([%$TOPIC/cc645135_en-us_VS_110_2_0_0_0_1%]))> _
Public Structure DataGridLength _
	Implements [%$TOPIC/cc645135_en-us_VS_110_2_0_0_0_2%](Of DataGridLength)
[[%$TOPIC/cc645135_en-us_VS_110_2_0_1_0_0%](typeof([%$TOPIC/cc645135_en-us_VS_110_2_0_1_0_1%]))]
public struct DataGridLength : [%$TOPIC/cc645135_en-us_VS_110_2_0_1_0_2%]<DataGridLength>
[[%$TOPIC/cc645135_en-us_VS_110_2_0_2_0_0%](typeof([%$TOPIC/cc645135_en-us_VS_110_2_0_2_0_1%]))]
public value class DataGridLength : [%$TOPIC/cc645135_en-us_VS_110_2_0_2_0_2%]<DataGridLength>
[<[%$TOPIC/cc645135_en-us_VS_110_2_0_3_0_0%]>]
[<[%$TOPIC/cc645135_en-us_VS_110_2_0_3_0_1%](typeof([%$TOPIC/cc645135_en-us_VS_110_2_0_3_0_2%]))>]
type DataGridLength =  
    struct 
        interface [%$TOPIC/cc645135_en-us_VS_110_2_0_3_0_3%]<DataGridLength>
    end

The DataGridLength type exposes the following members.

Constructors
  NameDescription
Public method DataGridLength(Double)Initializes a new instance of the DataGridLength class with an absolute value in pixels.
Public method DataGridLength(Double, DataGridLengthUnitType)Initializes a new instance of the DataGridLength class with a specified value and unit.
Public method DataGridLength(Double, DataGridLengthUnitType, Double, Double)Initializes a new instance of the DataGridLength class with the specified value, unit, desired value, and display value.
Top
Properties
  NameDescription
Public property Static member AutoGets a DataGridLength structure that represents the standard automatic sizing mode.
Public property DesiredValueGets the calculated pixel value needed for the element.
Public property DisplayValueGets the pixel value allocated for the size of the element.
Public property IsAbsoluteGets a value that indicates whether this instance sizes elements based on a fixed pixel value.
Public property IsAutoGets a value that indicates whether this instance automatically sizes elements based on both the content of cells and the column headers.
Public property IsSizeToCellsGets a value that indicates whether this instance automatically sizes elements based on the content of the cells.
Public property IsSizeToHeaderGets a value that indicates whether this instance automatically sizes elements based on the header.
Public property IsStarGets a value that indicates whether this instance automatically sizes elements based on a weighted proportion of available space.
Public property Static member SizeToCellsGets a DataGridLength structure that represents the cell-based automatic sizing mode.
Public property Static member SizeToHeaderGets a DataGridLength structure that represents the header-based automatic sizing mode.
Public property UnitTypeGets the type that is used to determine how the size of the element is calculated.
Public property ValueGets the absolute value of the DataGridLength in pixels.
Top
Methods
  NameDescription
Public method Equals(DataGridLength)Determines whether the specified DataGridLength is equal to the current DataGridLength.
Public method Equals(Object)Determines whether the specified object is equal to the current DataGridLength. (Overrides ValueTypeEquals(Object).)
Public method GetHashCodeGets a hash code for the DataGridLength. (Overrides ValueTypeGetHashCode.)
Public method GetTypeGets the Type of the current instance. (Inherited from Object.)
Public method ToStringReturns a string that represents the current object. (Overrides ValueTypeToString.)
Top
Operators
  NameDescription
Public operator Static member EqualityCompares two DataGridLength structures for equality.
Public operator Static member (Double to DataGridLength)Converts a Double to an instance of the DataGridLength class.
Public operator Static member InequalityCompares two DataGridLength structures to determine whether they are not equal.
Top
Version Information

.NET Framework

Supported in: 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4
Platforms

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.