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.v19.1.dll
Declaration
[Browsable(false)]
[DXCategory("Layout")]
[DefaultValue(ContextItemAlignment.TopNear)]
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.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Alignment property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.