Kendo Grid

1 Answer 99 Views
Top achievements
Rank 1
Raymond asked on 21 Apr 2023, 01:20 PM

hi, I have created a grid that works 'fine' and display one line as supposed, 

    .Columns(columns => {
        columns.Bound(p => p.PartID).Width(150);
        columns.Bound(p => p.ClassID);
        columns.Bound(p => p.PartListPrice).Width(100).Title("List Price");
        columns.Bound(p => p.PartDesc).Title("Description");
    .DataSource(dataSource => dataSource
        .Read(read => read.Action("Get_Part", "Home").Data("getParameter")))


I need now to read the value of column ClassID to reuse it so i tried the following code

var grid = $("#gridPart").data("kendoGrid");

grid.bind("change", function(e) {
    var dataItem = grid.dataSource.view()[0];
    if (dataItem) {
        var value = dataItem.columnName;

but got a message as unassigned

I would really appreciate any help


1 Answer, 1 is accepted

Sort by
Anton Mironov
Telerik team
answered on 25 Apr 2023, 07:39 AM

Hi Raymond,

Thank you for the code snippets and details provided.

As I can see in the code, the "columnName" is used, but never defined.

In order to get the needed value, I would recommend using the "document.ready" jQuery Event, or the DataBound event of the Grid. In the Event handler scope, use the following:

var grid = $("#grid").data("kendoGrid");
var dataItem = grid.dataItem("tbody tr:eq(0)");
The following article describes the approach to getting the first dataItem:

I hope this information helps. Let me know if further information or assistance is needed.

Kind Regards,
Anton Mironov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Asked by
Top achievements
Rank 1
Answers by
Anton Mironov
Telerik team
Share this question