- Home
- Forum
- ASP.NET MVC
- templating Grid groups
templating Grid groups
Hi Issam,
Thanks for using Syncfusion products.
Query : “is there a way to template groups for MVC grid?”
We are unable to understand your requirement clearly. Are you asking about the column template or grouping template in grid?
Please provide more detailed information about your requirement, which will be helpful for us to provide a better solution.
With Regards,
Prasanna Kumar N.S.V
i am porting a web application i did some time ago to syncfusion, here how it looks :

so actually red texts are groups , i want to replicate the same layout with sf mvc grid .
also it would be nice if i can disable groups collapsing .
thanks
Hi Issam,
We considered this requirement “Grouping Caption Template” as a feature . For your convenience, we have a created a workaround sample and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.
https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents
Regards,
Prasanna Kumar N.S.V
Thanks for the update,
Regards,
Prasanna Kumar N.S.V
We suggest you to use captionFormat API in the GroupSettings to change the group caption manually and upgrade to the latest version (13.4.0.53) to use this API.
Please find the code example and sample,
| @(Html.EJ().Grid<Sample118417.OrdersView>("FlatGrid") .Datasource((IEnumerable<object>)ViewBag.datasource) .AllowScrolling() .AllowPaging() /*Paging Enabled*/ .AllowGrouping() .GroupSettings(group => { group.GroupedColumns(col => { col.Add("ShipCity"); }).CaptionFormat("{{:field}} = {{:key}} && {{:count}}"); }) .Columns(col => { col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add(); col.Field("CustomerID").HeaderText("Customer ID").Width(80).Add(); col.Field("EmployeeID").HeaderText("Employee ID").TextAlign(TextAlign.Right).Width(75).Add(); col.Field("Freight").HeaderText("Freight").TextAlign(TextAlign.Right).Width(75).Format("{0:C}").Add(); col.Field("ShipCity").HeaderText("Ship City").Width(80).Add(); }) ) |
Sample : https://www.syncfusion.com/downloads/support/forum/118417/ze/Sample1184171512703556
Refer to the Help document for the captionFormat API,
http://help.syncfusion.com/js/api/ejgrid#members:groupsettings-captionformat
Regards,
Prasanna Kumar N.S.V
- 7 Replies
- 3 Participants
-
IS issam
- Mar 6, 2015 08:00 AM UTC
- Feb 18, 2016 09:25 AM UTC