DiagramCustomShape.ToolboxWidthToHeightRatio Property
Specifies the aspect ratio of the shape in the toolbox.
Namespace: DevExpress.Web.ASPxDiagram
Assembly: DevExpress.Web.ASPxDiagram.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
[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. |
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>
See Also