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
  • 37874
    posted

    Hi Tammy,

    I tested your code and I would suggest you to modify it as follows:

     

    Code Snippet
    1. @(Html.Infragistics().TileManager()
    2.  .ID("dashboard1")
    3.  .DataSource(list.AsQueryable())
    4.  .ContentTemplate("<h3>${Name}</h3>")
    5.  .DataBind()
    6.  .Render()
    7.  )

    Now it should be working correctly.

    Let me know if you have any other questions.

Children