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

Using a Kendo Switch instead of Checkbox in a Ajax paged Grid

1 Answer 178 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shafi
Top achievements
Rank 1
Shafi asked on 07 Dec 2016, 06:26 AM

I have been trying to use a Switch instead of a Checkbox in a non-mobile kendo grid instance built using Html helpers. I was able to build a dojo (http://dojo.telerik.com/ukafE) using javascript without paging. However, in real time, the grid load and brings data async-wise. The code that switches a checkbox to switch  already executes and is not able to find any checkboxes are they are still ajax-ing in the grid. If I put an alert, the grid loads a page while the message box is displayed and once I exit the message box, the get converted to switches.

How do I get to use switches in an Ajax Kendo grid built with Html Helper?

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 08 Dec 2016, 01:34 PM
Hello Shafi,

If the checkboxes are still not available when the code which transforms the checkboxes to switches is executed, I can suggest initializing the switches on the dataBound event of the Grid. This will ensure that the checkboxes will be already available:

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-dataBound

I hope this will help to achieve the desired result.

Regards,
Stefan
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
Tags
Grid
Asked by
Shafi
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or