Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2585
Binding JSON Datasource with razor
posted

Is there a special way to bind a JSON Datasource to the TileManager with Razor? We are trying the below and receiving an error.

            IList<Person> list = new List<Person>();
            list.Add( new Person(){Name="MDL"});

            return HtmlHelperExtensions.Infragistics(helper)
                .TileManager()
                .ID("dashboard")
                .DataSourceType("JSON")
                .DataSource(JsonConvert.SerializeObject(list))
                .Render();
Error: Cannot determine the data source type. Please specify if it is JSON or XML data.

Parents
No Data
Reply
  • 540
    Suggested Answer
    posted

    Hello Tammy,

    As we have released the RTM version of the Tile Manager the content template property was removed.
    Each tile now has two states - maximized and minimized and they have separate templates.
    To databind to a Datasource you can do as Nikolay showed in his example, just change the .ContentTemplate().

    Example:

    @(Html.Infragistics().TileManager()
        .ID("dashboard1")
        .DataSource(list.AsQueryable())
        .MinimizedState("<h3>${Name} minimized content</h3>")
        .MaximizedState("<h3>${Name} maximized content</h3>")
        .DataBind()
        .Render()
    )

Children
No Data