New to Telerik UI for WinForms? Start a free 30-day trial

Represents a table width as an automatic, fixed, or percentage value.

Definition

Namespace:Telerik.WinForms.Documents.Model

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
[TypeConverter(typeof(TableWidthUnitConverter))]
public class TableWidthUnit

Inheritance: objectTableWidthUnit

Constructors

Creates a fixed-width unit.

C#
public TableWidthUnit(double value)
Parameters:valuedouble

The width in document layout units.

Creates a width unit with an explicit type and value.

C#
public TableWidthUnit(TableWidthUnitType type, double value)
Parameters:typeTableWidthUnitType

How value is interpreted.

valuedouble

The absolute width or percentage, depending on type.

Creates a width unit without an explicit numeric value; this overload is used for Auto.

C#
public TableWidthUnit(TableWidthUnitType type)
Parameters:typeTableWidthUnitType

The width interpretation.

Properties

Gets whether the width is automatic, fixed, or percentage-based.

C#
public TableWidthUnitType Type { get; }

Gets the numeric width: an absolute layout width for Fixed or a percentage for Percent.

C#
public double Value { get; }

Methods

Calculates the width represented by this unit for the available table width.

C#
public float? Calculate(float availableWidth)
Parameters:availableWidthfloat

The available width in document layout units.

Returns:

float?

The fixed width or calculated percentage width, or null for Auto.

Determines whether another object represents the same width unit. Automatic units compare equal regardless of their stored value.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare.

Returns:

bool

true if the types and, unless automatic, values match; otherwise, false.

Overrides: object.Equals(object)

Returns a hash code based on the width type and value.

C#
public override int GetHashCode()
Returns:

int

A hash code for this width unit.

Overrides: object.GetHashCode()

Operators

Determines whether two width units have unequal values.

C#
public static bool operator !=(TableWidthUnit left, TableWidthUnit right)
Parameters:leftTableWidthUnit

The first width unit.

rightTableWidthUnit

The second width unit.

Returns:

bool

true if the units do not compare equal; otherwise, false.

Determines whether two width units have equal values, treating two null references as equal.

C#
public static bool operator ==(TableWidthUnit left, TableWidthUnit right)
Parameters:leftTableWidthUnit

The first width unit.

rightTableWidthUnit

The second width unit.

Returns:

bool

true if both references are null or the units compare equal; otherwise, false.