I want to perform automatic grouping at run-time under certain conditions. I am currently handling it by attaching to .DataBound event and if a js flag variable is set then I call:
var grid = $("#myGrid").data("kendoGrid");
grid.dataSource.group({ field: "FieldToBeGrouped" });
Is there a more recommended way?
Reason I am asking is I am noticing some oddities when it executes the grouping where it takes longer than expected and results in browser error Uncaught RangeError: Maximum call stack size exceeded. The end result does have the grid grouped as I would expect but the error and execution time is worrisome.
Note the field that is being grouped is listed as Hidden. Also I do not want to give the ability for the user to group other columns (or think that they can) so I have not included .Groupable() in order to not show the grouping toolbar. I did try including .Groupable() and still noticed same issues.