All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

DiagramCustomShape.ToolboxWidthToHeightRatio Property

Specifies the aspect ratio of the shape in the toolbox.

Namespace: DevExpress.Web.ASPxDiagram

Assembly: DevExpress.Web.ASPxDiagram.v20.2.dll

Declaration

[DefaultValue(typeof(decimal), "0")]
public decimal ToolboxWidthToHeightRatio { get; set; }
<DefaultValue(GetType(Decimal), "0")>
Public Property ToolboxWidthToHeightRatio As Decimal

Property Value

Type Default Description
Decimal

"0"

A decimal that is the width to height ratio. If the property is set to 0 (default value), the ratio is determined automatically.

Remarks

The size of a shape in a toolbox is determined automatically based on the toolbox width (SettingsToolbox.Width/SettingsContextToolbox.Width) and the number of shapes per row (SettingsToolbox.ShapeIconsPerRow/SettingsContextToolbox.ShapeIconsPerRow).

Use the ToolboxWidthToHeightRatio option to change the aspect ratio of the shape in a toolbox.

<dx:ASPxDiagram ID="Diagram" runat="server" Width="100%" Height="600px">
  <SettingsToolbox ShapeIconsPerRow="2">
    <Groups>
      <dx:DiagramToolboxGroup Category="Custom" CustomCategoryName="MyShapes" Title="My Shapes"/>
    </Groups>
  </SettingsToolbox>
  <SettingsContextToolbox Width="100" ShapeIconsPerRow="2"/>
  <CustomShapes>
      <dx:DiagramCustomShape CategoryName="MyShapes" Type="square" Title="Square" BaseType="Rectangle" 
        ToolboxWidthToHeightRatio ="1" DefaultHeight="1" DefaultWidth="1" />
      <dx:DiagramCustomShape CategoryName="MyShapes" Type="circle" Title="Circle" BaseType="Ellipse" 
        ToolboxWidthToHeightRatio ="1" DefaultHeight="1" DefaultWidth="1" />
    ...    
</dx:ASPxDiagram>

Custom shape - Ratio

See Also