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

Default Checkbox Selection as "Checked"

1 Answer 3206 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 05 Jan 2018, 02:14 PM

With the addition of the selectable column, is there a way to default the column so that everything is selected when the grid loads?

https://demos.telerik.com/kendo-ui/grid/checkbox-selection

1 Answer, 1 is accepted

Sort by
0
Accepted
Eduardo Serra
Telerik team
answered on 05 Jan 2018, 08:23 PM
Hello Steven,

There's currently no option in the Kendo UI Grid API that allows for setting the checkbox default state to selected.

If you just want to set their checked property to true, you could do this on the dataBound event:

$("#grid tbody input:checkbox").prop("checked", true);

If instead you want to select them and the rows they belong to, you can trigger their click in the dataBound event:

$("#grid tbody input:checkbox").trigger( "click" );

I have prepared a sample in the Kendo UI Dojo where you can try both of the options suggested above: take a look at it here.

Additionally, the checkbox at the column header can be configured to select all rows through all pages when clicked; this article in our documentation explains how it can be done.

If you think an option should be added to the API that allows for the default state of the checkboxes to be set to true, I encourage you to participate in the Kendo UI Feedback and Feature Request Portal to voice your opinion; if it gets enough votes, the feature you propose could be implemented by our developers in future releases.

I hope this helps!

Regards,
Eduardo Serra
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Steven
Top achievements
Rank 1
Answers by
Eduardo Serra
Telerik team
Share this question
or