We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

TypeError: this.model.currentViewData is undefined (In Implimentation of Hierarchical Grid --> Child Grid)

I am implementing a Hierarchy Grid in ASP.Net MVC using syncfusion Grid Control. I am following the example of this article. 
I am fetching the data from server side with an ajax call on the expansion of child grid. When i try to expand child grid, the ajax call fetches the data in JSON format and a JavaScript error (TypeError: this.model.currentViewData is undefined) occurs and data in the child grid doesn't load into child grid. I have attached sample project with this query. The URL for accessing the required page is (http://localhost:50364/Grid/GridFeatures). *Port Number after localhost will be different on your machine.

Any help is appriciated

Saud :)

Attachment: SynFusionPractice_661232df.zip

3 Replies

MS Mani Sankar Durai Syncfusion Team September 12, 2017 12:59 PM UTC

Hi Saud, 

Thanks for contacting Syncfusion support. 

We have checked the sample and we are able to reproduce the reported issue. From the sample provided we found that you have returned the result alone from server side instead of passing it as result and count pair. When using UrlAdaptor it is must to return the data as result and count pair.  So that it will bind the data to the grid.  
Refer the code example 
public JsonResult GetChildData(int _empID) 
            var ChildDaqtaSource = ChildData(_empID); 
            var count = ChildDaqtaSource.Count; 
            return Json(new { result = ChildDaqtaSource, count = count });  //pass it as result and count pair 

We have also modified a sample that can be downloaded from the below link. 
Refer the documentation link of UrlAdaptor 

Please let us know if you need further assistance. 

Manisankar Durai. 

SN Saud Nasir September 13, 2017 04:39 AM UTC

Hi Mani,

Solution worked. Thanx :)

MS Mani Sankar Durai Syncfusion Team September 14, 2017 04:52 AM UTC

Hi Saud, 

We are happy to hear that your problem has been solved.  

Please let us know if you need further assistance. 

Manisankar Durai. 

Live Chat Icon For mobile
Up arrow icon