Struct DataGridLength
Represents the lengths of elements within the DataGrid control.
Implements
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.Controls.Data.dll
Syntax
[TypeConverter(typeof(DataGridLengthConverter))]
public struct DataGridLength : IEquatable<DataGridLength>
Constructors
| Improve this Doc View SourceDataGridLength(Double)
Initializes a new instance of the DataGridLength class.
Declaration
public DataGridLength(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value |
DataGridLength(Double, DataGridLengthUnitType)
Initializes to a specified value and unit.
Declaration
public DataGridLength(double value, DataGridLengthUnitType type)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value to hold. |
DataGridLengthUnitType | type | The unit of |
Remarks
value
is ignored unless type
is
DataGridLengthUnitType.Pixel
or
DataGridLengthUnitType.Star
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
DataGridLength(Double, DataGridLengthUnitType, Double, Double)
Initializes to a specified value and unit.
Declaration
public DataGridLength(double value, DataGridLengthUnitType type, double desiredValue, double displayValue)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value to hold. |
DataGridLengthUnitType | type | The unit of |
System.Double | desiredValue | |
System.Double | displayValue |
Remarks
value
is ignored unless type
is
DataGridLengthUnitType.Pixel
or
DataGridLengthUnitType.Star
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
Properties
| Improve this Doc View SourceAuto
Gets a DataGridLength structure that represents the standard automatic sizing mode.
Declaration
public static readonly DataGridLength Auto { get; }
Property Value
Type | Description |
---|---|
DataGridLength | A DataGridLength structure that represents the standard automatic sizing mode. |
DesiredValue
Returns the desired value of this instance.
Declaration
public readonly double DesiredValue { get; }
Property Value
Type | Description |
---|---|
System.Double |
DisplayValue
Returns the display value of this instance.
Declaration
public readonly double DisplayValue { get; }
Property Value
Type | Description |
---|---|
System.Double |
IsAbsolute
Returns true
if this DataGridLength instance holds
an absolute (pixel) value.
Declaration
public readonly bool IsAbsolute { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsAuto
Returns true
if this DataGridLength instance is
automatic (not specified).
Declaration
public readonly bool IsAuto { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsSizeToCells
Returns true
if this instance is to size to the cells of a column or row.
Declaration
public readonly bool IsSizeToCells { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsSizeToHeader
Returns true
if this instance is to size to the header of a column or row.
Declaration
public readonly bool IsSizeToHeader { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsStar
Returns true
if this DataGridLength instance holds a weighted proportion
of available space.
Declaration
public readonly bool IsStar { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
SizeToCells
Gets a DataGridLength structure that represents the cell-based automatic sizing mode.
Declaration
public static readonly DataGridLength SizeToCells { get; }
Property Value
Type | Description |
---|---|
DataGridLength | A DataGridLength structure that represents the cell-based automatic sizing mode. |
SizeToHeader
Gets a DataGridLength structure that represents the header-based automatic sizing mode.
Declaration
public static readonly DataGridLength SizeToHeader { get; }
Property Value
Type | Description |
---|---|
DataGridLength | A DataGridLength structure that represents the header-based automatic sizing mode. |
UnitType
Gets the DataGridLengthUnitType that represents the current sizing mode.
Declaration
public readonly DataGridLengthUnitType UnitType { get; }
Property Value
Type | Description |
---|---|
DataGridLengthUnitType |
Value
Gets the absolute value of the DataGridLength in pixels.
Declaration
public readonly double Value { get; }
Property Value
Type | Description |
---|---|
System.Double | The absolute value of the DataGridLength in pixels. |
Methods
| Improve this Doc View SourceEquals(Object)
Compares this instance of DataGridLength with another object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Reference to an object for comparison. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
Equals(DataGridLength)
Compares this instance of DataGridLength with another instance.
Declaration
public bool Equals(DataGridLength other)
Parameters
Type | Name | Description |
---|---|---|
DataGridLength | other | DataGridLength length instance to compare. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetHashCode()
Returns a unique hash code for this DataGridLength
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | hash code |
Overrides
Operators
| Improve this Doc View SourceEquality(DataGridLength, DataGridLength)
Overloaded operator, compares 2 DataGridLength's.
Declaration
public static bool operator ==(DataGridLength gl1, DataGridLength gl2)
Parameters
Type | Name | Description |
---|---|---|
DataGridLength | gl1 | first DataGridLength to compare. |
DataGridLength | gl2 | second DataGridLength to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if specified DataGridLength have same value, unit type, desired value, and display value. |
Inequality(DataGridLength, DataGridLength)
Overloaded operator, compares 2 DataGridLength's.
Declaration
public static bool operator !=(DataGridLength gl1, DataGridLength gl2)
Parameters
Type | Name | Description |
---|---|---|
DataGridLength | gl1 | first DataGridLength to compare. |
DataGridLength | gl2 | second DataGridLength to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if specified DataGridLength have either different value, unit type, desired value, or display value. |