Back to Devexpress

DxToolbarItemBase.Alignment Property

blazor-devexpress-dot-blazor-dot-base-dot-dxtoolbaritembase-419462d2.md

latest2.8 KB
Original Source

DxToolbarItemBase.Alignment Property

Specifies the item’s position.

Namespace : DevExpress.Blazor.Base

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(ToolbarItemAlignment.Left)]
[Parameter]
public ToolbarItemAlignment Alignment { get; set; }

Property Value

TypeDefaultDescription
ToolbarItemAlignmentLeft

A ToolbarItemAlignment enumeration value.

|

Available values:

NameDescription
Left

The item is aligned to the left of the underlying container.

| | Right |

The item is aligned to the right of the underlying container.

|

Remarks

The Toolbar stretches to the container width. Use the item’s Alignment property to specify the item’s alignment (to the left or to the right) relative to the container boundaries.

Note

When you specify the Alignment property, the item order in markup is taken into account only for the items with the same property value (alignment).

razor
<DxToolbar>
    <DxToolbarItem Text="Insert" Alignment="ToolbarItemAlignment.Right"></DxToolbarItem>
    <DxToolbarItem Text="Edit" Alignment="ToolbarItemAlignment.Left"></DxToolbarItem>
    <DxToolbarItem Text="Delete" Alignment="ToolbarItemAlignment.Right"></DxToolbarItem>
</DxToolbar>

If you divide Toolbar items into groups, the component aligns grouped items according to the group first item’s Alignment property value.

razor
<div class="card p-2">
    <DxToolbar>
        <DxToolbarItem Text="Item" />
        <DxToolbarItem Text="Link to the next demo" 
                       NavigateUrl="https://demos.devexpress.com/blazor/Toolbar#DropDown" />
        <DxToolbarItem BeginGroup="true" IconCssClass="oi oi-align-left" />
        <DxToolbarItem IconCssClass="oi oi-align-center" />
        <DxToolbarItem IconCssClass="oi oi-align-right" />
        <DxToolbarItem IconCssClass="oi oi-cog" 
                       Alignment="ToolbarItemAlignment.Right" 
                       BeginGroup="true" />
        <DxToolbarItem Text="About" IconCssClass="oi oi-info" />
    </DxToolbar>
</div>

See Also

DxToolbarItemBase Class

DxToolbarItemBase Members

DevExpress.Blazor.Base Namespace