menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class CellMarginsInfo - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class CellMarginsInfo

    Provides a StyleInfoSubObjectBase object for margins in a cell. Each margin side of the cell can be configured individually with a System.Windows.Thickness value. Margin sides that have not been initialized will inherit default values from a base style.

    Inheritance
    System.Object
    StyleInfoBase
    StyleInfoSubObjectBase
    CellMarginsInfo
    Implements
    IStyleInfo
    System.ComponentModel.ISupportInitialize
    System.IFormattable
    System.IConvertible
    System.Xml.Serialization.IXmlSerializable
    IStyleInfoSubObject
    System.IDisposable
    Inherited Members
    StyleInfoBase.BeginInit()
    StyleInfoBase.BeginUpdate()
    StyleInfoBase.CacheValues
    StyleInfoBase.Changed
    StyleInfoBase.Changing
    StyleInfoBase.ClearCache()
    StyleInfoBase.CopyFrom(IStyleInfo)
    StyleInfoBase.CreateSubObjectIdentity(StyleInfoProperty)
    StyleInfoBase.EndInit()
    StyleInfoBase.EndUpdate()
    StyleInfoBase.Equals(Object)
    StyleInfoBase.EqualsObject(Object, Object)
    StyleInfoBase.GetDefaultStyleInfoStore(StyleInfoProperty)
    StyleInfoBase.GetDefaultValue(StyleInfoProperty)
    StyleInfoBase.GetHashCode()
    StyleInfoBase.GetShortValue(StyleInfoProperty)
    StyleInfoBase.GetValue(StyleInfoProperty)
    StyleInfoBase.HasValue(StyleInfoProperty)
    StyleInfoBase.IConvertible.GetTypeCode()
    StyleInfoBase.IConvertible.ToBoolean(IFormatProvider)
    StyleInfoBase.IConvertible.ToByte(IFormatProvider)
    StyleInfoBase.IConvertible.ToChar(IFormatProvider)
    StyleInfoBase.IConvertible.ToDateTime(IFormatProvider)
    StyleInfoBase.IConvertible.ToDecimal(IFormatProvider)
    StyleInfoBase.IConvertible.ToDouble(IFormatProvider)
    StyleInfoBase.IConvertible.ToInt16(IFormatProvider)
    StyleInfoBase.IConvertible.ToInt32(IFormatProvider)
    StyleInfoBase.IConvertible.ToInt64(IFormatProvider)
    StyleInfoBase.IConvertible.ToSByte(IFormatProvider)
    StyleInfoBase.IConvertible.ToSingle(IFormatProvider)
    StyleInfoBase.IConvertible.ToString(IFormatProvider)
    StyleInfoBase.IConvertible.ToType(Type, IFormatProvider)
    StyleInfoBase.IConvertible.ToUInt16(IFormatProvider)
    StyleInfoBase.IConvertible.ToUInt32(IFormatProvider)
    StyleInfoBase.IConvertible.ToUInt64(IFormatProvider)
    StyleInfoBase.Identity
    StyleInfoBase.IsChanged
    StyleInfoBase.IsEmpty
    StyleInfoBase.IsSubset(IStyleInfo)
    StyleInfoBase.IsValueModified(StyleInfoProperty)
    StyleInfoBase.MergeStyle(IStyleInfo)
    StyleInfoBase.ModifyStyle(IStyleInfo, StyleModifyType)
    StyleInfoBase.OnStyleChanging(StyleInfoProperty)
    StyleInfoBase.ParseString(String)
    StyleInfoBase.ReadXml(XmlReader)
    StyleInfoBase.ResetValue(StyleInfoProperty)
    StyleInfoBase.SetStore(StyleInfoStore)
    StyleInfoBase.SetValue(StyleInfoProperty, Int16)
    StyleInfoBase.SetValue(StyleInfoProperty, Object)
    StyleInfoBase.Store
    StyleInfoBase.ToString()
    StyleInfoBase.ToString(String)
    StyleInfoBase.ToString(String, IFormatProvider)
    StyleInfoBase.Updating
    StyleInfoBase.WeakReferenceChangedListeners
    StyleInfoBase.WriteXml(XmlWriter)
    StyleInfoSubObjectBase.Data
    StyleInfoSubObjectBase.Dispose()
    StyleInfoSubObjectBase.IntGetDefaultStyleInfo(StyleInfoProperty)
    StyleInfoSubObjectBase.OnStyleChanged(StyleInfoProperty)
    StyleInfoSubObjectBase.Owner
    StyleInfoSubObjectBase.Sip
    StyleInfoSubObjectBase.SubObjectIdentity
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Syncfusion.Windows.Controls.Cells
    Assembly: Syncfusion.GridCommon.WPF.dll
    Syntax
    public class CellMarginsInfo : StyleInfoSubObjectBase, IStyleInfo, ISupportInitialize, IFormattable, IConvertible, IXmlSerializable, IStyleInfoSubObject, IDisposable
    Examples

    The following code changes margin information for cells:

                Thickness margins = new Thickness(1, 1, 2, 2);
                model[rowIndex, colIndex].BorderMargins = new CellMarginsInfo(margins);
                model[rowIndex, colIndex+1].BorderMargins.Right = 2;
                model[rowIndex, colIndex+1].BorderMargins.Left = 2;

    Constructors

    CellMarginsInfo()

    Initializes a new empty CellMarginsInfo object.

    Declaration
    public CellMarginsInfo()

    CellMarginsInfo(StyleInfoSubObjectIdentity)

    Initalizes a new CellMarginsInfo object and associates it with an existing CachedStyleInfoSubObjectIdentity.

    Declaration
    public CellMarginsInfo(StyleInfoSubObjectIdentity identity)
    Parameters
    Type Name Description
    StyleInfoSubObjectIdentity identity

    A CachedStyleInfoSubObjectIdentity that holds the indentity for this CellMarginsInfo.

    CellMarginsInfo(StyleInfoSubObjectIdentity, CellMarginsInfoStore)

    Initalizes a new CellMarginsInfo object and associates it with an existing CachedStyleInfoSubObjectIdentity.

    Declaration
    public CellMarginsInfo(StyleInfoSubObjectIdentity identity, CellMarginsInfoStore store)
    Parameters
    Type Name Description
    StyleInfoSubObjectIdentity identity

    A CachedStyleInfoSubObjectIdentity that holds the indentity for this CellMarginsInfo.

    A CellMarginsInfoStore that holds data for this CellMarginsInfo. All changes in this style object will saved in the CellMarginsInfoStore object.
    CellMarginsInfoStore store

    CellMarginsInfo(Double)

    Initializes a new empty CellMarginsInfo object with default value applied.

    Declaration
    public CellMarginsInfo(double value)
    Parameters
    Type Name Description
    System.Double value

    CellMarginsInfo(Double, Double, Double, Double)

    Initializes a CellMarginsInfo and saves left, top, right and bottom margins.

    Declaration
    public CellMarginsInfo(double left, double top, double right, double bottom)
    Parameters
    Type Name Description
    System.Double left

    Left margin.

    System.Double top

    The top margin.

    System.Double right

    The right margin.

    System.Double bottom

    The bottom margin.

    CellMarginsInfo(Thickness)

    Initializes a CellMarginsInfo and copies settings from a System.Windows.Thickness object.

    Declaration
    public CellMarginsInfo(Thickness margins)
    Parameters
    Type Name Description
    System.Windows.Thickness margins

    Properties

    Bottom

    The bottom margin

    Declaration
    public double Bottom { get; set; }
    Property Value
    Type
    System.Double

    Default

    Returns a default CellMarginsInfo to be used with a default style.

    Declaration
    public static CellMarginsInfo Default { get; }
    Property Value
    Type
    CellMarginsInfo

    Empty

    Returns a empty CellMarginsInfo.

    Declaration
    public static CellMarginsInfo Empty { get; }
    Property Value
    Type
    CellMarginsInfo

    HasBottom

    Determines if the bottom margin has been initialized.

    Declaration
    public bool HasBottom { get; }
    Property Value
    Type
    System.Boolean

    HasLeft

    Determines if the left margin has been initialized.

    Declaration
    public bool HasLeft { get; }
    Property Value
    Type
    System.Boolean

    HasRight

    Determines if the right margin has been initialized.

    Declaration
    public bool HasRight { get; }
    Property Value
    Type
    System.Boolean

    HasTop

    Determines if the top margin has been initialized.

    Declaration
    public bool HasTop { get; }
    Property Value
    Type
    System.Boolean

    Left

    The left margin

    Declaration
    public double Left { get; set; }
    Property Value
    Type
    System.Double

    Right

    The right margin

    Declaration
    public double Right { get; set; }
    Property Value
    Type
    System.Double

    Top

    The top margin

    Declaration
    public double Top { get; set; }
    Property Value
    Type
    System.Double

    Methods

    CreateObject(StyleInfoSubObjectIdentity, Object)

    Creates the CellMarginsInfo object.

    Declaration
    public static object CreateObject(StyleInfoSubObjectIdentity identity, object store)
    Parameters
    Type Name Description
    StyleInfoSubObjectIdentity identity

    The identity.

    System.Object store

    The store.

    Returns
    Type
    System.Object

    GetDefaultStyle()

    Declaration
    protected override StyleInfoBase GetDefaultStyle()
    Returns
    Type
    StyleInfoBase
    Overrides
    StyleInfoBase.GetDefaultStyle()

    MakeCopy(StyleInfoBase, StyleInfoProperty)

    Declaration
    public override IStyleInfoSubObject MakeCopy(StyleInfoBase newOwner, StyleInfoProperty sip)
    Parameters
    Type Name Description
    StyleInfoBase newOwner
    StyleInfoProperty sip
    Returns
    Type
    IStyleInfoSubObject
    Overrides
    StyleInfoSubObjectBase.MakeCopy(StyleInfoBase, StyleInfoProperty)

    ResetBottom()

    Resets the bottom margin

    Declaration
    public void ResetBottom()

    ResetLeft()

    Resets the left margin

    Declaration
    public void ResetLeft()

    ResetRight()

    Resets the right margin

    Declaration
    public void ResetRight()

    ResetTop()

    Resets the top margin

    Declaration
    public void ResetTop()

    ToThickness()

    Converts this object to a System.Windows.Thickness object.

    Declaration
    public Thickness ToThickness()
    Returns
    Type Description
    System.Windows.Thickness

    A System.Windows.Thickness object filled with the current objects settings.

    ToThickness(CellMarginsInfo)

    Creates a System.Windows.Thickness object comibing margins.

    Declaration
    public Thickness ToThickness(CellMarginsInfo other)
    Parameters
    Type Name Description
    CellMarginsInfo other
    Returns
    Type Description
    System.Windows.Thickness

    A System.Windows.Thickness object filled with the current objects settings.

    Explicit Interface Implementations

    IDisposable.Dispose()

    Declaration
    void IDisposable.Dispose()

    Implements

    IStyleInfo
    System.ComponentModel.ISupportInitialize
    System.IFormattable
    System.IConvertible
    System.Xml.Serialization.IXmlSerializable
    IStyleInfoSubObject
    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved