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

new GroupSettings on ejGrid

Hello, I've created a grid in my project and I want to enable the grouping so I've add "allow-grouping="true" but I want also an initial grouping but with the command "group-settings ="@(new GroupSettings { GroupedColumns= new List() { "ShipCountry" } })"" it returns me an error saying that GroupSettings could not be found.I've also tried with  between the and the but it returns me that doesn't allow it as a child.How can I solve this problem? Thanks, best regards.David UPDATE: adding Syncfusion.JavaScript.Models.GroupSettings it seems i solved that problem but now it appears the initial grouping during the loading and suddenly disappears on loaded page, seems like it falls back on a default value...

3 Replies

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team May 12, 2017 11:25 AM UTC

Hi David, 

Thanks for contacting syncfusion support. 

While checking your code for initialGrouping, you have  mentioned the “GroupedColumns= new List()” instead “GroupedColumns = new List<string>()”  that leads to your reported problem. Please follow the syntax as per given code example and Help document. 

Please refer to the code example:- 

<ej-grid id="FlatGrid" allow-paging="true" allow-grouping="true" group-settings ="@(new GroupSettings { GroupedColumns= new List<string>() { "CustomerID" } })" > 
<e-datamanager url="/Home/DataSource" insert-url="/Home/CellEditInsert" update-url="/Home/CellEditUpdate" remove-url="/Home/CellEditDelete"  adaptor="UrlAdaptor" ></e-datamanager> 
        <e-column field="OrderID" is-primary-key="true" header-text="Order ID" text-align="Right" width="70"></e-column> 
        <e-column field="CustomerID" header-text="Customer ID" width="80"></e-column> 

Please refer to the Help document :- 


Farveensulthana T 

DM Dmitriy June 21, 2017 01:12 PM UTC


This example https://help.syncfusion.com/aspnet-core/grid/grouping?cs-save-lang=1&cs-lang=razor#initial-grouping doesn't work (There is no class GroupSettings at all). If delete initial grouping and try group manually - there are no result. Please, help.


Also try to use this example http://aspnetcore.syncfusion.com/grid/grouping 

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team June 22, 2017 12:35 PM UTC

Hi David,  
We suspect you are missing namespace Syncfusion.JavaScript.Models in the Grid page. So we suggest to follow the code example and update the same at your end.  
@using Syncfusion.JavaScript.Models; 
<ej-grid id="FlatGrid"  allow-paging="true" datasource="ViewBag.data" allow-grouping="true" group-settings ="@(new GroupSettings { GroupedColumns= new List<string>() { "CustomerID" } })"> 
        <e-column field="ID" header-text="Order ID" is-primary-key="true" text-align="Right" width="75"> </e-column> 
        <e-column field="CustomerID" header-text="Customer ID" width="80"></e-column> 
        <e-column field="EmployeeID" header-text="Employee ID" text-align="Left" width="75"></e-column> 
We have prepared a sample that can be downloaded from the following location.  
If you are still facing any problem, please share the following details to analyze the problem at our end.  
1)      Code example of the Grid 
2)      Screenshot for the issue 
3)      If possible, modify the attached sample and reproduce the issue 
Seeni Sakthi Kumar S. 

Live Chat Icon For mobile
Up arrow icon