Show / Hide Table of Contents

Struct DataGridLength

Represents the lengths of elements within the DataGrid control.

Implements
System.IEquatable<DataGridLength>
Inherited Members
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: System.Windows.Controls
Assembly: OpenSilver.Controls.Data.dll
Syntax
[TypeConverter(typeof(DataGridLengthConverter))]
public struct DataGridLength : IEquatable<DataGridLength>

Constructors

| Improve this Doc View Source

DataGridLength(Double)

Initializes a new instance of the DataGridLength class.

Declaration
public DataGridLength(double value)
Parameters
Type Name Description
System.Double value
| Improve this Doc View Source

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 value.

Remarks

value is ignored unless type is DataGridLengthUnitType.Pixel or DataGridLengthUnitType.Star

Exceptions
Type Condition
System.ArgumentException

If value parameter is double.NaN or value parameter is double.NegativeInfinity or value parameter is double.PositiveInfinity.

| Improve this Doc View Source

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 value.

System.Double desiredValue
System.Double displayValue
Remarks

value is ignored unless type is DataGridLengthUnitType.Pixel or DataGridLengthUnitType.Star

Exceptions
Type Condition
System.ArgumentException

If value parameter is double.NaN or value parameter is double.NegativeInfinity or value parameter is double.PositiveInfinity.

Properties

| Improve this Doc View Source

Auto

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.

| Improve this Doc View Source

DesiredValue

Returns the desired value of this instance.

Declaration
public readonly double DesiredValue { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

DisplayValue

Returns the display value of this instance.

Declaration
public readonly double DisplayValue { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

IsAbsolute

Returns true if this DataGridLength instance holds an absolute (pixel) value.

Declaration
public readonly bool IsAbsolute { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsAuto

Returns true if this DataGridLength instance is automatic (not specified).

Declaration
public readonly bool IsAuto { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

UnitType

Gets the DataGridLengthUnitType that represents the current sizing mode.

Declaration
public readonly DataGridLengthUnitType UnitType { get; }
Property Value
Type Description
DataGridLengthUnitType
| Improve this Doc View Source

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 Source

Equals(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

true if this DataGridLength instance has the same value and unit type as oCompare.

Overrides
System.ValueType.Equals(System.Object)
| Improve this Doc View Source

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

true if this DataGridLength instance has the same value and unit type as gridLength.

| Improve this Doc View Source

GetHashCode()

Returns a unique hash code for this DataGridLength

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

hash code

Overrides
System.ValueType.GetHashCode()

Operators

| Improve this Doc View Source

Equality(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.

| Improve this Doc View Source

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.

Implements

System.IEquatable<T>
  • Improve this Doc
  • View Source