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
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.
Hello Greg,
I'm glad you were able to resolve your issue.
Here in our documentation you can find three different articles about how to bind igHierarchicalGrid to DataSet, REST Services and ASP.NET MVC WebAPI, for your reference:
http://www.igniteui.com/help/ighierarchicalgrid-binding-to-rest-services-landingpage
If you need further assistance, please let me know.
Regards,
Tsanna
Tsanna, thanks for the article I found it very helpful I wish I had found it sooner.
The MVC example includes the following line which indicates to me that the MVC grid maybe just doesn't support loading parent and child records all in one go from a single URL using the DataSourceUrl property:
By default, the igHierarchicalGrid child layouts’ request URLs are constructed the following way:
Url/RootPrimaryKeyID/Child1LayoutName/Child1PrimaryKeyID/Child2LayoutName/Child2PrimaryKeyID
Thank you for your feedback.
I'm glad you were able to resolve your issue. If I can provide you with further assistance, feel free to contact me.