Skip to main content
A newer version of this page is available. .
Bar

BarEditItem Class

Represents a bar item that allows you to embed any editor from the DXEditors library into bars.

Namespace: DevExpress.Xpf.Bars

Assembly: DevExpress.Xpf.Core.v21.1.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

public class BarEditItem :
    BarItem

The following members return BarEditItem objects:

Remarks

This bar item allows you to embed editors into bars. You can embed any editor provided by the DXEditors library.

BarEditItem

To embed an editor, set the BarEditItem.EditSettings property to a corresponding descendant of the BaseEditSettings class. For instance, to embed a DateEdit editor into bars, assign the BarEditItem.EditSettings property to a new instance of the DateEditSettings class. The DateEdit control will be automatically created based on the provided EditSettings object. To provide values for the in-place editor, use the BarEditItem.EditValue property.

At runtime, you can access the embedded editor directly via a link’s BarEditItemLink.Editor property.

Commands are not supported for BarEditItem objects.

Example

This example shows how to embed in-place editors into a bar using BarEditItem objects. Two editors (DateEdit and SpinEdit) are added with the BarEditItem.EditSettings property. Values for the editors are provided using the EditValue property.

The following image shows the result:

E1549

View Example

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" 
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
        xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" 
        x:Class="CreateBarEditItems.Window2"
        Title="Window2" Height="300" Width="300">
    <Grid>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>


        <dxb:BarContainerControl Grid.Row="0">
            <dxb:ToolBarControl>
                <!--Create a DateEdit and SpinEdit in-place editors -->
                <dxb:BarEditItem x:Name="editItemDateEdit1" Content="Date" EditValue="01/01/2010">
                    <dxb:BarEditItem.EditSettings>
                        <dxe:DateEditSettings />
                    </dxb:BarEditItem.EditSettings>
                </dxb:BarEditItem>
                <dxb:BarEditItem x:Name="editItemSpinEdit1" Content="Value" EditValue="123" EditWidth="50">
                    <dxb:BarEditItem.EditSettings>
                        <dxe:SpinEditSettings />
                    </dxb:BarEditItem.EditSettings>
                </dxb:BarEditItem>

            </dxb:ToolBarControl>
        </dxb:BarContainerControl>



        <DockPanel Name="dockPanel1" LastChildFill="False" VerticalAlignment="Stretch">
            <!--Create a BarContainerControl that will display bars at the top of the DockPanel-->
            <dxb:BarContainerControl x:Name="TopBarContainer" DockPanel.Dock="Right" ContainerType="Right">
            </dxb:BarContainerControl>
        </DockPanel>





    </Grid>

</Window>

The following code snippets (auto-collected from DevExpress Examples) contain references to the BarEditItem class.

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.

Implements

See Also