Click here to Skip to main content
15,347,117 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
HTML
function AllcarDetails() {

        $.ajax({

            type: "GET",

            url: "http://localhost:63461/api/CarDetails",

            dataType: "json",

            success: function (data) {

                //alert(this.url)

		var grid = $('#grid').kendoGrid();
                grid.dataSource.data(data);

                //var datavalue = data;

                //var myJsonObject = datavalue;

                //alert(data["Table"][0].Voucher_No);

                //debugger;

                
                alert('bought all data successfully');
            },
            error: function (xhr) {
                alert(xhr.responseText);
            }
        });
    }
Posted
Updated 26-Feb-22 12:35pm
v4
Comments
Suvendu Shekhar Giri 20-Nov-15 5:29am
   
add some description about the problem to your question.
Sathish km 20-Nov-15 6:04am
   
i want to bind the data from "success: function (data)" to kendoGrid UI. I tried but it's not working. give me a solution
Krunal Rohit 20-Nov-15 5:43am
   
I don't see any kendo grid here in your code.

-KR
Sathish km 20-Nov-15 5:58am
   
@(Html.Kendo().Grid<webapp.models.carsstock>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(c => c.CarID).Width(140);
columns.Bound(c => c.CarModel).Width(190);
columns.Bound(c => c.CarName);
columns.Bound(c => c.CarPrice).Width(110);
columns.Bound(c => c.CarColor).Width(150);
})
.HtmlAttributes(new { style = "height: 300px;" })
.Scrollable()

//.Sortable()
//.Pageable(pageable => pageable
// .Refresh(true)
// .PageSizes(true)
// .ButtonCount(5))
.DataSource(dataSource => dataSource
.Ajax()
//.Read(read => read.Action("Customers_Read", "Grid"))
)
)*@

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900