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
1415
Binding .MVC Grid to Heirarchical objects using JSON
posted

 Can someone provide me with a simple example of doing this?  I want to load parent and child records all at once and bind to them.  I have it working now with just the parent records but whenever I try to click the plus sign to view the child records I get cryptic errors like "0x800a138f - JavaScript runtime error: Unable to get property 'length' of undefined or null reference".  The JSON is definitely returning correctly but I'm not sure what the grid is unhappy about.

I have been looking through the Ignite UI examples but haven't been able to get this working.

 Greg

Parents
No Data
Reply
  • 1415
    Verified Answer
    Offline posted

    After much trial and error, it appears that hierarchical binding works when you create a view with Html.Infragistics().Grid() for an action returning JSON.
    Also, hierarchical binding works when binding using Ajax to a URL returning JSON. (very slow to draw.. looks like it expands each branch individually)

    However, I never was able to get hierarchical binding working using .DataSourceUrl method of Html.Infragistics().Grid().  I could display the top level but expanding out any of the lower branches always gave the error listed above.

    Hopefully this saves someone else some experimenting.  It would be helpful to have more working examples of different ways to bind the Grid control.

       Greg

Children