Skip to main content
All docs

DiagramCustomShape.ToolboxWidthToHeightRatio Property

Specifies the aspect ratio of the shape in the toolbox.

Namespace: DevExpress.Web.ASPxDiagram

Assembly: DevExpress.Web.ASPxDiagram.v23.1.dll

NuGet Package: DevExpress.Web


[DefaultValue(typeof(decimal), "0")]
public decimal ToolboxWidthToHeightRatio { get; set; }

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.


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">
      <dx:DiagramToolboxGroup Category="Custom" CustomCategoryName="MyShapes" Title="My Shapes"/>
  <SettingsContextToolbox Width="100" ShapeIconsPerRow="2"/>
      <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" />

Custom shape - Ratio

See Also