Posted 2 November 2017, 8:18 pm EST
How can I check and uncheck all checkboxes of a column from checkbox present in header.
Forums Home / Spread / Spread for ASP.NET (Web Forms)
Posted by: sandyaveas on 2 November 2017, 8:18 pm EST
Posted 2 November 2017, 8:18 pm EST
How can I check and uncheck all checkboxes of a column from checkbox present in header.
Posted 6 November 2017, 2:00 am EST
Hello,
You can create a custom checkbox cell type for Header cell and handle it’s click event client side to set the checkbox value for whole column. Please refer to the attached sample application.
Thanks,
Deepak SharmaSpreadASPHeaderCheckbox.zip
Posted 17 April 2018, 8:32 pm EST
Hi Deepak, My mistake I forgot to mention that I’m using MVC not webforms.
And the Javascript code which you have written I’ve tried with the same but it’s not working.
Need:
In UI I’ve kept 1st column of type checkbox from header checkbox I want check uncheck all the rows and after post the Spread on server side I should get the checked rows.
Issue:
Posted 20 April 2018, 2:35 am EST
Hello,
Since you are working with MVC application, you can set the value of all checkboxes in rows at client side by handling the click of header checkbox. You can use jQuery or JavaScript to do that.
You can get all the selected rows index and save it in an array. You can then send it back to server through ViewBag or Ajax.
Thanks,
Deepak Sharma