Skip to main content

ContextItem.Alignment Property

Gets or sets the current item’s alignment relative to the owner control. This property is obsolete, use ContextItem.AlignmentOptions instead.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v24.1.dll

NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core

Declaration

[Browsable(false)]
[DefaultValue(ContextItemAlignment.TopNear)]
[DXCategory("Layout")]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual ContextItemAlignment Alignment { get; set; }

Property Value

Type Default Description
DevExpress.Utils.ContextItemAlignment TopNear

A ContextItemAlignment enumeration value that specifies the current item’s alignment relative to the owner control.

Remarks

The Alignment property specifies the alignment of the current item relative to the owner control. Depending on the item’s alignment, it is:

  • placed in the corresponding panel: top, bottom, near, far, or center (the first statement of the ContextItemAlignment enumeration value specifies the panel into which the item is placed);

    Note

    Note that the alignment affects the item’s orientation—in the side panels, items are vertically oriented.

  • aligned relative to the panel: near, far, or middle for horizontally oriented panels; top, bottom, or center for vertically oriented (the second statement of the value).

    Note

    Note that the top and bottom panels, when displayed, overlap the near and far panels, and thus shift items in the latter nearer to center. Also note that if the owner control is right-to-left aligned (see Right-to-Left Layout), near aligned items are right aligned.

To specify the panel’s back color and padding, use the corresponding settings accessible through the owner control’s ContextButtonOptions property.

If aligning relative to the owner control does not meet your needs, you can align the current item relative to another item—anchor element. See the ContextItem.AnchorAlignment property to learn more.

See Also