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

Bind json source to grid in asp.net without mvc

4 Answers 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sandeep
Top achievements
Rank 1
Sandeep asked on 25 Jan 2016, 06:23 AM

Hi,

I am binding JSON data to grid.but facing issue on it

can u pls provide example for asp.net without mvc to bind data to kendo grid.

  <div id="grid"></div>
            <script>
                $(document).ready(function () {

                    $.ajax({
                        type: "POST",
                        url: "Default.aspx/Test,
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function (response) {
                            BindGrid(response.d);
                        }
                    });
                });

                function BindGrid(sourcedata) {
                    $("#grid").kendoGrid({
                        sortable: true,
                        groupable: true,
                        scrollable: true,
                        height: "300px",
                        pageable: {
                            pageSizes: 9
                        },
                        dataSource: sourcedata
                    });
                }
            </script>

 

 

4 Answers, 1 is accepted

Sort by
0
Sandeep
Top achievements
Rank 1
answered on 25 Jan 2016, 06:26 AM

[{"column1":"10.28.212.88","ProcessDt":"\/Date(1431687934000)\/"},{"column1":"10.28.212.88","ProcessDt":"\/Date(1431687934000)\/"}

{"column1":"10.28.212.88","ProcessDt":"\/Date(1431687934000)\/"}]

0
Alexander Valchev
Telerik team
answered on 27 Jan 2016, 09:44 AM
Hi Sandeep,

In order to get the binding to work you should apply the following change in the success event handler of the Ajax request:

success: function (response) {
    BindGrid(response);
}


On a side note you may check this repository as it contains sample which demonstrate how to bind Kendo Grid to various server side technologies:


Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Miguel Angel
Top achievements
Rank 1
answered on 10 Mar 2016, 10:51 AM

Hi Alexander

I have the same problem in kendo grid mvc, can you help me?

 

0
Alexander Valchev
Telerik team
answered on 14 Mar 2016, 08:39 AM
Hi Miguel Angel,

The scenario discussed in this topic is not relevant to the Kendo UI for MVC wrappers.
Please open a new thread for your problem and provide more details/sample code so we can examine it and advise you accordingly.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Sandeep
Top achievements
Rank 1
Answers by
Sandeep
Top achievements
Rank 1
Alexander Valchev
Telerik team
Miguel Angel
Top achievements
Rank 1
Share this question
or