Skip to main content

DiagramEdge.Text Property

Specifies the text of the edge.

Namespace: DevExpress.Web.ASPxDiagram

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

NuGet Package: DevExpress.Web

Declaration

public string Text { get; set; }

Property Value

Type Description
String

The edge text.

Remarks

The Text property can be specified in the following formats:

  • A plain text (for instance, "text") displayed in the middle of a connector.
  • A JSON object (for instance, "{ \"0.3\": \"text1\", \"0.8\": \"text2\" }") that contains multiple texts and their positions on the connector. The position is a number from 0 to 1, where 0 corresponds to the connector’s start point and 1 to the connector’s end point.
<dx:ASPxDiagram ID="Diagram" runat="server" Width="100%" Height="600px"
    NodeDataSourceID="FlowNodeDemoDataSource" EdgeDataSourceID="FlowEdgeDemoDataSource"
    OnEdgeDataBound="Diagram_EdgeDataBound">
    <Mappings>
        <Node Key="ID" Type="Type" Width="Width" Height="Height" />
        <Edge Key="ID" FromKey="FromID" ToKey="ToID" Text="Text" />
    </Mappings>
</dx:ASPxDiagram>
protected void Diagram_EdgeDataBound(object sender, DevExpress.Web.ASPxDiagram.DiagramEdgeEventArgs e) {
    if (e.Edge.Text == "No") {
        e.Edge.Style = "stroke: red";
        e.Edge.TextStyle = "fill: red";

    }
    if (e.Edge.Text == "Yes") {
        e.Edge.Style = "stroke: green";
        e.Edge.TextStyle = "fill: green";

    }
}
See Also