how to get selected row value in the KendoUI

2 posts, 0 answers
  1. John
    John avatar
    2 posts
    Member since:
    Oct 2012

    Posted 18 Oct 2012 Link to this post

    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
    });


  2. Eric J at FADV
    Eric J at FADV avatar
    17 posts
    Member since:
    Oct 2012

    Posted 27 Oct 2012 Link to this post

    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!
Back to Top