Skip to main content
A newer version of this page is available. .
All docs
V20.2

DiagramCustomShape.KeepRatioOnAutoSize Property

Specifies whether the shape maintains its width-to-height ratio on auto resize

Namespace: DevExpress.Web.ASPxDiagram

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

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(false)]
public bool KeepRatioOnAutoSize { get; set; }

Property Value

Type Default Description
Boolean **false**

true to maintain the shape’s width-to-height ratio; otherwise, false.

Remarks

When the Diagram control is bound to a data source, shapes are resized to fit the shape’s text. Set the KeepRatioOnAutoSize property to true to maintain the width-to-height ratio of the shape on auto resize.

<dx:ASPxDiagram ID="Diagram" runat="server" Width="100%" Height="600px" 
  NodeDataSourceID="DepartmentDemoDataSource" OnNodeInserted="Diagram_NodeInserted">
    <CustomShapes>
        <dx:DiagramCustomShape CategoryName="Departments" Type="Finance" KeepRatioOnAutoSize="true" ... />
        ...
See Also