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

Kendo Grid Checkbox/Radio Buttons not maintang selections on Grid Actions

3 Answers 1675 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mohammad Faraaz
Top achievements
Rank 1
Veteran
Mohammad Faraaz asked on 05 Oct 2020, 02:25 PM

Hi Kendo Team,

We have the following issues with radio button/checkboxes in a Grid:

1) In our grids, we have radio buttons or checkboxes for selection of records. However, on sorting or filtering, the selections are lost. Please advise how to maintain selections.

2) We have a grid which has is a bound column with custom template of a checkbox like so:

columns.Bound(m => m.Indicator)
            .Title("Is Indicator")
            .Template(@<text></text>)       
.ClientTemplate(
                                            "<input name='Indicator-#=(Id)?Id:uid#' id='Indicator-#=(Id)?Id:uid#' type='checkbox' #= Indicator ? checked='checked':'' # class='k-checkbox bind-checkbox'  data-column-key='Indicator' />" +
                                            "<label class='k-checkbox-label' for='Indicator-#=(Id)?Id:uid#'></label>" +
                                            "<input name='view-value-#=(Id)?Id:uid#' type='hidden' value='#=Indicator#'>")
                                            .Width(80);

When this grid is in a full page, the filtering/sorting maintains the checkbox selection. However, when this grid is in a kendoWindow popup, the selections are not maintained. Please advise.

Thanks.

 

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 07 Oct 2020, 12:38 PM

Hi Mohammad,

 

You can achieve both of these requirements using the following approach:

1. Replace the existing templates with the built-in CheckBox Selection column of the grid:
https://demos.telerik.com/kendo-ui/grid/checkbox-selection

2. Use the property below to persist the user selection:
https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/persistselection

I hope this will prove helpful.

 

Regards,
Eyup
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Mohammad Faraaz
Top achievements
Rank 1
Veteran
answered on 09 Oct 2020, 10:52 AM

Hi Eyup,

Most of our grids have Radio Button to select a row instead of checkbox. Will this support for radio buttons as well?

Also regarding my 2nd issue, the checkboxes are input fields for users to select for multiple indicators. These persist during filtering/sorting if the grid is in a Full Page. Id the grid is opened in a kendoWindow the same grid's checkboxes do not retain their selections on filtering/sorting.

Please advise.

Thanks.

0
Eyup
Telerik team
answered on 13 Oct 2020, 10:40 AM

Hello Mohammad,

 

In this case, you can use the following solution:
https://docs.telerik.com/kendo-ui/knowledge-base/persist-row-selection-while-paging

I am also sending a sample MVC project to demonstrate a more advanced implementation.

 

Regards,
Eyup
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Mohammad Faraaz
Top achievements
Rank 1
Veteran
Answers by
Eyup
Telerik team
Mohammad Faraaz
Top achievements
Rank 1
Veteran
Share this question
or