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
close icon

Grouping on Grid


Hi, 

I want to group the grid by following the examples in the documentation, but I have an error "UnpaidBills_JSONTemplate"

This is the code that I use

@(Html.EJ().Grid<BillData>("UnpaidBills")
            .Datasource(ds => ds.Json((IEnumerable<BillData>)ViewBag.UnpaidBills))           
            .AllowGrouping()
            .GroupSettings(group => { group.GroupedColumns(col => { col.Add("Vendor");}); })
            .PageSettings(paging => paging.PageSize(50))
            .AllowFiltering()
            .FilterSettings(filter => { filter.FilterType(FilterType.Excel); })           
            .Columns(col =>
            {
                col.Field("Id").IsPrimaryKey(true).Visible(false).Add();
                col.Field("Vendor").HeaderText("Proveedor").TextAlign(TextAlign.Center).Width(70).AllowEditing(false).Priority(1).Add();
                col.Field("RefNumber").HeaderText("Factura").TextAlign(TextAlign.Center).Width(35).AllowEditing(false).Add();
                col.Field("TxnDate").HeaderText("Fecha").Format("{0:dd/MM/yyyy}").TextAlign(TextAlign.Center).Width(30).AllowEditing(false).Add();
                col.Field("DueDate").HeaderText("Vencimiento").Format("{0:dd/MM/yyyy}").TextAlign(TextAlign.Center).Width(42).AllowEditing(false).Add();               
            })          
        )

And the result is like this


Vendor: ABC LEASING DE MEXICO SAPI DE CV - 2 artículos
UnpaidBills_JSONTemplateUnpaidBills_JSONTemplate


Vendor: AMERICAN POWER CONVERSION U - 1 artículos
UnpaidBills_JSONTemplate


Vendor: BARMEX, S.A. DE CV - 4 artículos
UnpaidBills_JSONTemplateUnpaidBills_JSONTemplateUnpaidBills_JSONTemplateUnpaidBills_JSONTemplate



Please Help. What am I doing wrong? What have I miss or overlook?



1 Reply

KK Karthick Kuppusamy Syncfusion Team September 27, 2016 01:23 PM UTC

Hi Dayne, 

Thanks for Contacting Syncfusion support. 

We have analyzed the provided code and we are not able to reproduce the reported issue at our end with the provided information. 

Please find the code example. 

 
@(Html.EJ().Grid<object>("FlatGrid") 
        .Datasource((IEnumerable<object>)ViewBag.datasource) 
        .AllowScrolling() 
         .AllowPaging()    
            .AllowGrouping()  
          .GroupSettings(group => { group.GroupedColumns(col => { col.Add("CustomerID"); }); })//grouped columns 
           .AllowFiltering() 
           .FilterSettings(filter => { filter.FilterType(FilterType.Excel); })           
          .SelectionType(SelectionType.Single) 
               .ToolbarSettings(toolbar => 
                { 
                    toolbar.ShowToolbar().ToolbarItems(items => 
                    { 
                        items.AddTool(ToolBarItems.Add); 
                        items.AddTool(ToolBarItems.Edit); 
                        items.AddTool(ToolBarItems.Delete); 
                        items.AddTool(ToolBarItems.Update); 
                        items.AddTool(ToolBarItems.Cancel); 
                    }); 
                }) 
                .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); }) 
                .Columns(col => 
        { 
            col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Visible(false).TextAlign(TextAlign.Right).Width(75).Add(); 
            . 
            . 
            . 
          })) 


For your reference we have created a sample based on your requirement and same it can be downloaded from the following location. 

Online Link: 

Please share the following details to us it would be helpful for us to find the prompt solution. 

1.Please share the controller code. 

2.Please reproduce the issue in the attached sample and revert back to us if it is possible. 

3.Share more details about your requirement to reproduce the issue. 


Regards, 
K.Karthick. 

 


Loader.
Live Chat Icon For mobile
Up arrow icon