MVC Kendo Treemap Data

2 posts, 0 answers
  1. Stefan
    Stefan avatar
    4 posts
    Member since:
    Jul 2017

    Posted 12 Jul Link to this post

    Hello,

    is it possible to set a C# list as data for the Kendo Treemap?

     

    Thanks in advance.

     

     

  2. Stefan
    Admin
    Stefan avatar
    1147 posts

    Posted 14 Jul Link to this post

    Hello Stefan,

    The Kendo UI TreeMap can be used with the standard C# List.

    For example, if we have a model with value and text, the TreeMap can receive the following:

    public static List<TreeMapValue> treeMapValue = new List<TreeMapValue>();
     
            static HomeController()
            {
                treeMapValue.Add(new TreeMapValue { ID = 1, Value = 10, text = "custom" });
            }
    ......
     
    public ActionResult GetTreeMapValues([DataSourceRequest] DataSourceRequest dsRequest)
            {
                var result = treeMapValue.ToDataSourceResult(dsRequest);
                return Json(result);
            }

    I hope this is helpful.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top