We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

templating Grid groups

Hi,

is there a way to template groups for MVC grid?

7 Replies

PK Prasanna Kumar Viswanathan Syncfusion Team March 9, 2015 12:45 PM UTC

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




IS issam March 9, 2015 02:22 PM UTC

yes sorry for the lack of informations .

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



PK Prasanna Kumar Viswanathan Syncfusion Team March 10, 2015 05:38 PM UTC

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




IS issam March 16, 2015 03:48 PM UTC

thanks .


PK Prasanna Kumar Viswanathan Syncfusion Team March 17, 2015 12:45 PM UTC

Hi Issam,

Thanks for the update,

Regards,

Prasanna Kumar N.S.V


CO coffeebean February 17, 2016 08:03 AM UTC

Hi, 

I need something similar, is there an update on this and a sample on how to get this look and feel?


PK Prasanna Kumar Viswanathan Syncfusion Team February 18, 2016 09:25 AM UTC

Hi Issam,

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


Loader.
Up arrow icon