This project is read-only.

unable to use CheckBoxFor with @Html.ThemedDataGridFor for rows selection

Oct 9, 2014 at 8:19 PM
Edited Oct 9, 2014 at 8:19 PM
how to add/use the CheckBoxFor with @Html.ThemedDataGridFor to select/unselect all rows?
Do you have any good example?
Oct 11, 2014 at 10:22 AM
Basically add a class to all grid row roots, for instance "row-root". Then attach to all checkboxes a click handler that do the following:
  • var row=$(this).closest('row-root'), to find the row root it is contained in.
  • then row.addClass('selected-class') or row.removeClass('selected-class') to select or unselect the row. Where "selected-class" is a class that gives the selected appearence to the row.
  • gridRow.find('selected-class') to find all selected grid rows. Whete gridRow is a jUQery node containing the whole grid.
The Mvc Controls Toolkit is just a toolkit you may use to define easily server controls, but doesn't contain completely out-of the box controls. If you don't want to spend time to define controls that fits your needs you may consider purchasing the commercial controls suite based on the Mvc Controls Toolkit, whose controls are compeltely out-of-the-box, and require a minimum effort to be used in any application. In this case the selection functionlity is already available in any grid.
Oct 11, 2014 at 11:59 PM
Thank you!