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

MVC-Grid Grouping Event and ServerOverride

1 Answer 371 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 17 Sep 2014, 12:59 PM
I have some legacy hand rolled T-SQL that I am now displaying in the Kendo MVC Grid.  It can handle paging/sorting but not server grouping. I have most of it working but would like to know how to do a few things.

  1. How can I use server paging/sorting and use local grouping.  I can do it client side but not using the Razor helpers. (no option to turn off just 1 option) I figured out how to do it in JS post render but not ideal.  ($("#grid").data("kendoGrid").dataSource.options.serverGrouping = false;)
  2. There does not seem to be a columnGrouped event?  Every time I group a column I would like to set it as the First sorted column and hide the column from display.  Then refresh the grid back to page 1 and have the client side group up results (which should be similar to server grouping).  All of the example I have seen are using the "Databound" event but that seems to late in the callstack to be forcing a different search/ui change.  I suppose I could try overriding the parameter list?

 


1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 19 Sep 2014, 02:42 PM
Hi Andy,

You are correct, the ASP.NET MVC wrappers do not provide an option to specify which operations should be performed client-side and which server-side.  This is not supported, because the DataSource generated by the wrappers uses a specialized, pre-defined transport layer that is configured to work seamlessly with the wrappers. Your second claim is also correct - there is no dedicated event for the column grouping. You could however, subscribe to the DataSource's change event and check if the group method returns different results from the previous time the event was triggered. This would allow you to detect changes in the grouping options and take the necessary actions when that happens.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Andy
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or