{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "grid-grouping",
  "framework": "blazor",
  "type": "registry:component",
  "component": "Grid",
  "variant": "grouping",
  "dependencies": [
    "Syncfusion.Blazor.Grids"
  ],
  "description": "Grouped orders grid combines sorting, menu filtering, paging, validation, and toolbar-based add, edit, and delete actions.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 2 (v34.1.29)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/blazor/llms.txt",
    "skillPack": "syncfusion/blazor-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/blazor/grid-grouping.md"
  },
  "files": [
    {
      "target": "src/components/grid-grouping/DataSource.cs",
      "content": "using System;\nusing System.Collections.Generic;\n\nnamespace BlazorDemos.Pages.Grid\n{   \n    public class Orders\n    {\n        public Orders()\n        {\n\n        }\n        public Orders(int OrderID, string CustomerId, int EmployeeId, double Freight, bool Verified, DateOnly OrderDate, TimeOnly OrderTime, string ShipCity, string ShipName, string ShipCountry, DateTime ShippedDate, string ShipAddress)\n        {\n            this.OrderID = OrderID;\n            this.CustomerID = CustomerId;\n            this.EmployeeID = EmployeeId;\n            this.Freight = Freight;\n            this.ShipCity = ShipCity;\n            this.Verified = Verified;\n            this.OrderDate = OrderDate;\n            this.OrderTime = OrderTime;\n            this.ShipName = ShipName;\n            this.ShipCountry = ShipCountry;\n            this.ShippedDate = ShippedDate;\n            this.ShipAddress = ShipAddress;\n        }\n        public static IReadOnlyList<Orders> GetAllRecords()\n        {\n            List<Orders> orders = new List<Orders>();\n            int code = 10000;\n            for (int i = 1; i < 15; i++)\n            {\n                orders.Add(new Orders(code + 1, \"ALFKI\", i + 0, Math.Round((2.3 * i), 2) , false, new DateOnly(1991, 05, 15), new TimeOnly(10, 00, 00), \"Berlin\", \"Simons bistro\", \"Denmark\", new DateTime(1996, 7, 16), \"Kirchgasse 6\"));\n                orders.Add(new Orders(code + 2, \"ANATR\", i + 2, Math.Round((3.3 * i), 2) , true, new DateOnly(1990, 04, 04), new TimeOnly(11, 30, 00), \"Madrid\", \"Queen Cozinha\", \"Brazil\", new DateTime(1996, 9, 11), \"Avda. Azteca 123\"));\n                orders.Add(new Orders(code + 3, \"ANTON\", i + 1, Math.Round((4.3 * i), 2) , true, new DateOnly(1957, 11, 30), new TimeOnly(12, 00, 00), \"Cholchester\", \"Frankenversand\", \"Germany\", new DateTime(1996, 10, 7), \"Carrera 52 con Ave. Bolívar #65-98 Llano Largo\"));\n                orders.Add(new Orders(code + 4, \"BLONP\", i + 3, Math.Round((5.3 * i), 2) , false, new DateOnly(1930, 10, 22), new TimeOnly(15, 30, 00), \"Marseille\", \"Ernst Handel\", \"Austria\", new DateTime(1996, 12, 30), \"Magazinweg 7\"));\n                orders.Add(new Orders(code + 5, \"BOLID\", i + 4, Math.Round((6.3 * i), 2) , true, new DateOnly(1953, 02, 18), new TimeOnly(16, 30, 00), \"Tsawassen\", \"Hanari Carnes\", \"Switzerland\", new DateTime(1997, 12, 3), \"1029 - 12th Ave. S.\"));\n                code += 5;\n            }\n            return orders;\n        }\n\n        public int? OrderID { get; set; }\n        public string? CustomerID { get; set; }\n        public int? EmployeeID { get; set; }\n        public double? Freight { get; set; }\n        public string? ShipCity { get; set; }\n        public bool Verified { get; set; }\n        public DateOnly? OrderDate { get; set; }\n\n        public TimeOnly? OrderTime { get; set; }\n\n        public string? ShipName { get; set; }\n\n        public string? ShipCountry { get; set; }\n\n        public DateTime ShippedDate { get; set; }\n        public string? ShipAddress { get; set; }\n    }\n}"
    },
    {
      "target": "src/components/grid-grouping/Grid.razor",
      "content": "@page \"/datagrid/grouping\"\n@using Syncfusion.Blazor.Grids\n@using BlazorDemos.Pages.Grid\n\n<div class=\"col-lg-12 control-section\">\n    <div class=\"content-wrapper\">\n        <div class=\"row\">\n            <SfGrid DataSource=\"@GridData\" Height=\"400\" AllowGrouping=\"true\" AllowSorting=\"true\" AllowFiltering=\"true\" Toolbar=\"@(new List<string>() { \"Edit\", \"Delete\", \"Update\", \"Cancel\" })\" AllowPaging=\"true\">\n                <GridEditSettings AllowAdding=\"true\" AllowDeleting=\"true\" AllowEditing=\"true\" ></GridEditSettings>\n                <GridGroupSettings Columns=\"@GroupedColumns\" PersistGroupState=\"@isGroupStatePersistent\"></GridGroupSettings>\n                <GridFilterSettings Type=\"FilterType.Menu\"></GridFilterSettings>\n                <GridColumns>\n                    <GridColumn Field=@nameof(Orders.OrderID) IsPrimaryKey=\"true\" HeaderText=\"Order ID\" ValidationRules=\"@(new ValidationRules{ Required=true, Number=true})\" TextAlign=\"TextAlign.Right\" Width=\"120\"></GridColumn>\n                    <GridColumn Field=@nameof(Orders.CustomerID) HeaderText=\"Customer ID\" ValidationRules=\"@(new ValidationRules{ Required=true})\" Width=\"100\"></GridColumn>\n                    <GridColumn Field=@nameof(Orders.Freight) Format=\"C2\" TextAlign=\"TextAlign.Right\" ValidationRules=\"@(new ValidationRules{ Required=true, Range = new object[]{1, 1000}})\" AllowGrouping=false Width=\"120\"></GridColumn>\n                    <GridColumn Field=@nameof(Orders.OrderDate) HeaderText=\" Order Date\" Format=\"d\" Type=\"ColumnType.DateOnly\" TextAlign=\"TextAlign.Right\" Width=\"100\"></GridColumn>\n                    <GridColumn Field=@nameof(Orders.OrderTime) HeaderText=\"Order Time\" Type=\"ColumnType.TimeOnly\" TextAlign=\"TextAlign.Right\" Width=\"100\"></GridColumn>\n                </GridColumns>\n            </SfGrid>\n        </div>\n    </div>\n</div>\n@code{\n    public string[] GroupedColumns = new string[] { \"CustomerID\" };\n    public List<Orders>? GridData { get; set; }\n    private bool isGroupStatePersistent { get; set; }\n    private bool isChecked { get; set; } = false;\n    private void onChange(Microsoft.AspNetCore.Components.ChangeEventArgs args)\n    {\n        if (args.Value != null)\n        isGroupStatePersistent = (bool)args.Value;\n    }\n    protected override void OnInitialized()\n    {\n        GridData = Orders.GetAllRecords().ToList();\n    }\n}"
    }
  ]
}