Connection color from model

2 posts, 1 answers
  1. Zoltan
    Zoltan avatar
    4 posts
    Member since:
    Feb 2012

    Posted 18 Jan Link to this post

    Hello,

    I need to set stroke color of individual connections between shapes depending on Model data from Controller.

     Is that possible with Html.Kendo() helper?

     

    .DataSource(d => d
            .Read(read => read.Action("_SomeDiagram", "Diagram"))
            .Model(m => {
                m.Children("Entities");
                m.Id("Name"); }))  
    .ConnectionDefaults(c => c.Stroke(s => s.Color("#979797").Width(2)))

     

    ViewModel structure is simple with one root entity and three children.

  2. Answer
    T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 21 Jan Link to this post

    Hi,

    We can use the connection redraw method to carry these changes after the widget is data bound.

    See this snippet for reference. I hope this helps.

    Regards,
    T. Tsonev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top