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

how to get selected row value in the KendoUI

1 Answer 877 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 18 Oct 2012, 10:11 PM
I have a KendoUI Grid.


        @(Html.Kendo().Grid<EntityVM>()
            .Name("EntitesGrid")
                        .HtmlAttributes(new { style = "height:750px;width:100%;scrollbar-face-color: #eff7fc;" })
            .Columns(columns =>
            {
                columns.Bound(e => e.Id).Hidden().IncludeInMenu(false);
                columns.Bound(e => e.EntityVersionId).Hidden().IncludeInMenu(false);
                columns.Bound(e => e.Name).Width("70%").Title("Entity Name");
                columns.Bound(e => e.EIN).Width("30%");
            })
.ToolBar(toolBar => toolBar.Template("<a class='k-button k-button-icontext k-grid-add' id='addEntity'><span class='k-icon k-add'></span>Entity</a>" +
     "<a class='k-button k-button-icontext' id='editEntity'><span class='k-icon k-edit'></span>Edit</a>"))
            .DataSource(dataSource => dataSource
            .Ajax().ServerOperation(false)
            .Model(model => model.Id(e => e.Id))
            .Read(read => read.Action("GetEntities", "Entity", new { projectId = Request.QueryString[DataKeyNameConstants.ProjectId] })))
            .Sortable()
            .Scrollable()
            .Filterable()
            .Resizable(resize => resize.Columns(true))
            .Reorderable(reorder => reorder.Columns(true))
            .ColumnMenu()
            .Selectable(s => s.Mode(GridSelectionMode.Multiple))
            .Events(events => events.Change("entSelChange"))
    )

now, I need to get the value of EntityVersionId from the selected Row. but not sure how to do it.

here's my javascript function

$("#editEntity").click(function () {
 
    var entityGrid = $("#EntitesGrid").data("kendoGrid");
 
    // what should I do from here
});


1 Answer, 1 is accepted

Sort by
0
Eric J at FADV
Top achievements
Rank 1
answered on 27 Oct 2012, 07:19 PM
I had the same question and found the answer in another post on the same subject:

http://www.kendoui.com/forums/mvc/grid/getting-the-selected-row-data-on-grid-change-event.aspx

works great!
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Eric J at FADV
Top achievements
Rank 1
Share this question
or