Skip to main content

DiagramNode.Style Property

Specifies the node style.

Namespace: DevExpress.Web.ASPxDiagram

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

NuGet Package: DevExpress.Web

Declaration

public string Style { get; set; }

Property Value

Type Description
String

A string that specifies the style settings.

Remarks

The style settings must be specified as inline style declarations in string format.

<dx:ASPxDiagram ID="Diagram" runat="server" Width="100%" Height="700px"
    NodeDataSourceID="OrgItemDemoDataSource" EdgeDataSourceID="OrgLinkDemoDataSource"
    OnNodeDataBound="Diagram_NodeDataBound">
    <Mappings>
        <Node Key="ID" Text="Text" Type="Type" ImageUrl="Picture" />
        <Edge Key="ID" FromKey="FromID" ToKey="ToID" />
    </Mappings>
</dx:ASPxDiagram>
protected void Diagram_NodeDataBound(object sender, DevExpress.Web.ASPxDiagram.DiagramNodeEventArgs e)
{
    if ((DiagramShapeType)e.Node.Type == DiagramShapeType.Ellipse) {
        e.Node.Style = "stroke: red";
        e.Node.TextStyle = "font-weight: bold; text-decoration: underline";
    }
}

The image below shows the result.

DiagramNode - Styles

See Also