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

How to obtain selected items in Grid?

1 Answer 207 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 21 Nov 2017, 02:07 PM

Hello,

 

I saw the demo here: http://demos.telerik.com/aspnet-core/grid/checkbox-selection

I'm trying to do the same, but I can't get it to work.
this is my code: 

 

       @(Html.Kendo().Grid<CalculationResultModel>()
.Name("Grid")
.Columns(columns =>
{
    columns.Select().Width(50);
   ...
})
.Events(ev => ev.Change("onChange"))
   .DataSource(dataSource => dataSource
     .Ajax()
     .ServerOperation(true)
     .Model(model => model.Id(m => m.CalculationRequestIdentification))
     .Read(read => read.Action("x", "x").Type(HttpVerbs.Get))

     )
        )

when I call the selectedKeyName() function in the javascript, I get an empty array.

Any Idea why that can be? The Id is a Guid btw.

 

Thanks!

 

 

1 Answer, 1 is accepted

Sort by
0
Steven
Top achievements
Rank 1
answered on 22 Nov 2017, 08:21 AM

Wow... sorry , missed this line of code: .PersistSelection()

It works now.

Tags
Grid
Asked by
Steven
Top achievements
Rank 1
Answers by
Steven
Top achievements
Rank 1
Share this question
or