Back to Devexpress

BaseLayoutItem.ItemWidth Property

wpf-devexpress-dot-xpf-dot-docking-dot-baselayoutitem-217515f6.md

latest6.8 KB
Original Source

BaseLayoutItem.ItemWidth Property

Gets or sets the width for the specified BaseLayoutItem object. This is a dependency property.

Namespace : DevExpress.Xpf.Docking

Assembly : DevExpress.Xpf.Docking.v25.2.dll

NuGet Package : DevExpress.Wpf.Docking

Declaration

csharp
public GridLength ItemWidth { get; set; }
vb
Public Property ItemWidth As GridLength

Property Value

TypeDescription
GridLength

A GridLength object, which is the width of the specified BaseLayoutItem object.

|

Remarks

This property does not allow you to specify the width of the following items:

If a LayoutPanel object is positioned within an AutoHideGroup, the panel’s ItemWidth property is not updated when an end user resizes the auto-hide group horizontally at runtime.

When items are horizontally lined up inside a LayoutGroup (the LayoutGroup.Orientation property is set to Horizontal ), you can use the ItemWidth property to change the width of individual items, while the item height (BaseLayoutItem.ItemHeight) cannot be changed in this case.

Note

Use the MDISize property to specify the DocumentPanel size.

The following code sample sets the TopGroup height to 150 pixels (ItemHeight property), the DocumentGroup width to 3/4 of the window width, and the Toolbox width to 1/4 of the window width ( ItemWidth property):

xaml
<dx:ThemedWindow ...
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking">
    <Grid>
        <dxdo:DockLayoutManager>
            <dxdo:LayoutGroup x:Name="LayoutRoot" Orientation="Vertical">
                <dxdo:LayoutGroup x:Name="TopGroup" ItemHeight="150">
                    <dxdo:LayoutPanel Caption="Toolbox" ItemWidth="*"/>
                    <dxdo:DocumentGroup ItemWidth="3*">
                        <dxdo:DocumentPanel Caption="Document1">
                          <!-- ... -->
                        </dxdo:DocumentPanel>
                        <dxdo:DocumentPanel Caption="Document2"/>
                          <!-- ... -->
                        </dxdo:DocumentGroup>
                </dxdo:LayoutGroup>
                <dxdo:TabbedGroup>
                    <dxdo:LayoutPanel Caption="Solution Explorer"/>
                    <dxdo:LayoutPanel Caption="Properties"/>
                </dxdo:TabbedGroup>
            </dxdo:LayoutGroup>
        </dxdo:DockLayoutManager>
    </Grid>
</dx:ThemedWindow>

The following code snippets (auto-collected from DevExpress Examples) contain references to the ItemWidth 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.

wpf-dock-layout-manager-limit-layout-group-customization-at-runtime/CS/DXDockingForLayoutPurposes/MainWindow.xaml#L56

xml
</dxd:LayoutControlItem>
<dxd:LayoutControlItem Name="victimHomeState" Caption="State" VerticalAlignment="Top" ItemWidth="115">
    <dxe:TextEdit/>

wpf-dock-layout-manager-define-prism-regions-for-dock-layout-manager-elements/CS/PrismOnDXDocking/Shell.xaml#L78

xml
<dxdo:LayoutGroup ItemHeight="0.7*" Orientation="Horizontal">
    <dxdo:LayoutGroup Name="leftGroup" prism:RegionManager.RegionName="{x:Static Infrastructure:RegionNames.LeftRegion}" ItemWidth="0.2*" />
    <dxdo:DocumentGroup Name="documentContainer" ItemWidth="0.6*" MDIStyle="MDI" prism:RegionManager.RegionName="{x:Static Infrastructure:RegionNames.MainRegion}" DestroyOnClosingChildren="False"/>

wpf-scheduler-use-entity-framework-to-bind-to-data/CS/DXSample/MainWindow.xaml#L35

xml
Caption="Navigation"
              ItemWidth="300">
<dxlc:LayoutControl Orientation="Vertical">

wpf-docklayoutmanager-dock-panels-in-code/CS/DockPanelInCode_Ex/Window1.xaml#L19

xml
Caption="Output"
ItemWidth="250">
<RichTextBox />

wpf-dock-layout-manager-save-and-restore-the-dock-layout-managers-layout/CS/MainWindow.xaml#L16

xml
<dxdo:LayoutGroup Name="root">
    <dxdo:LayoutPanel Name="panel1" Caption="Panel1" ItemWidth="3*">
        <dxg:GridControl Name="grid">

See Also

ItemHeight

BaseLayoutItem Class

BaseLayoutItem Members

DevExpress.Xpf.Docking Namespace