This is a migrated thread and some comments may be shown as answers.

Does not bind kendo grid with json response data.

1 Answer 149 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Quest Resource Management
Top achievements
Rank 1
Quest Resource Management asked on 05 Nov 2012, 08:46 AM
Hello All,

 I am try to bind kendo grid with json response.

View
var dataSource = new kendo.data.DataSource({              
 
                transport: {
                    read: {
                        url: baseurl + "/Vendor/getData",
                        type: "POST",
                        dataType: "json"
                    }
                }
            });
 
            $("#mygrid").kendoGrid({
                dataSource: dataSource,
                height: 280               
            });
<div id="mygrid">
            </div>

Controller
[HttpPost]
        public ActionResult getData([DataSourceRequest]DataSourceRequest request)
        {
            var vendorRegistrationTask = (IVendorRegistrationTask)new VendorTaskFactory<VendorRegistrationTask>().CreateObject();
            var dataitem = vendorRegistrationTask.getDocument(10);
            DataSourceResult result = dataitem.ToDataSourceResult(request);
             
            return Json(result ,JsonRequestBehavior.AllowGet);
        }

Thanks in an advance.

1 Answer, 1 is accepted

Sort by
0
pucsoftware
Top achievements
Rank 1
answered on 09 Nov 2012, 03:17 PM
You need to supply an example of what your JSON looks like for anybody to help you with this. I'm guessing your data records are encapsulated in a property and you don't have the "data" property set.
Tags
Grid
Asked by
Quest Resource Management
Top achievements
Rank 1
Answers by
pucsoftware
Top achievements
Rank 1
Share this question
or