/syncfusion-aspnet-core:syncfusion-aspnetcore-tree-gridfrom Syncfusion ASP.NET Core UI Controls
Implements Syncfusion ASP.NET Core TreeGrid for hierarchical data with sorting, filtering, editing, exporting, paging, virtual scrolling, and advanced features. Supports configuration, CRUD, aggregates, templates, state persistence, and performance optimization in ASP.NET Core applications.
Ships in Syncfusion ASP.NET Core UI Controls. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The TreeGrid component visualizes self-referential hierarchical data in a tabular format. It supports child/parent data binding (via childMapping or idMapping), expand/collapse of child rows, sorting, filtering, editing, paging, export, and virtualization.
Refer to Properties & Configuration, Events & Lifecycle, and Classes & Enums Reference files for complete API lookup.
Severity: 🔴 CRITICAL - Grid will not expand/collapse without this
Requirement:
CSHTML View:
<!-- ✅ REQUIRED - childMapping matches data property name exactly -->
<ejs-treegrid id="TreeGrid" dataSource="@ViewBag.data" childMapping="Children"
treeColumnIndex="1" allowPaging="true">
<e-treegrid-columns>
<e-treegrid-column field="TaskId" headerText="Task ID"
isPrimaryKey="true" textAlign="Right" width="95"></e-treegrid-column>
<e-treegrid-column field="TaskName" headerText="Task Name" width="220"></e-treegrid-column>
<e-treegrid-column field="Duration" headerText="Duration" textAlign="Right" width="100"></e-treegrid-column>
</e-treegrid-columns>
</ejs-treegrid>
<!-- ❌ WRONG - No childMapping = No expansion possible -->
<ejs-treegrid id="TreeGrid2" dataSource="@ViewBag.data">
<!-- Missing childMapping & treeColumnIndex - Won't expand! -->
</ejs-treegrid>
Data Format C# Model:
public class TreeGridItem
{
public int TaskId { get; set; }
public string TaskName { get; set; }
public int Duration { get; set; }
public List<TreeGridItem> Children { get; set; } // Must match childMapping="Children"
}
// Sample data
var data = new List<TreeGridItem>
{
new TreeGridItem
{
TaskId = 1,
TaskName = "Planning",
Duration = 5,
Children = new List<TreeGridItem> // ✅ CORRECT - nested Children property
{
new TreeGridItem { TaskId = 2, TaskName = "Identify Site", Duration = 2 },
new TreeGridItem { TaskId = 3, TaskName = "Perform Test", Duration = 3 }
}
}
};
Alternative: Flat Structure with Parent IDs:
<!-- Use idMapping + parentIdMapping instead of childMapping -->
<ejs-treegrid id="TreeGrid" dataSource="@ViewBag.flatData"
idMapping="TaskId" parentIdMapping="ParentId" treeColumnIndex="1">
...
</ejs-treegrid>
var flatData = new List<TreeGridItem>
{
new TreeGridItem { TaskId = 1, TaskName = "Planning", ParentId = null },
new TreeGridItem { TaskId = 2, TaskName = "Identify Site", ParentId = 1 },
new TreeGridItem { TaskId = 3, TaskName = "Perform Test", ParentId = 1 }
};
Severity: 🟠 IMPORTANT - Type mismatches cause rendering/sorting issues
C# Model - Correct Types:
public class TreeGridItem
{
public int TaskId { get; set; } // ✅ int type
public string TaskName { get; set; } // ✅ string type
public DateTime StartDate { get; set; } // ✅ DateTime for date columns
public decimal Price { get; set; } // ✅ decimal for currency
}
var data = new List<TreeGridItem>
{
new TreeGridItem
{
TaskId = 1, // int, not string "1"
TaskName = "Planning",
StartDate = new DateTime(2024, 3, 15), // DateTime, not "03/15/2024"
Price = 1500.50m // decimal, not string "1500.50"
}
};
CSHTML Column Definition - Match Data Types:
<ejs-treegrid id="TreeGrid" dataSource="@ViewBag.data" childMapping="Children">
<e-treegrid-columns>
<!-- field "TaskId" is int, so type="number" -->
<e-treegrid-column field="TaskId" headerText="Task ID"
type="number" textAlign="Right" width="95"></e-treegrid-column>
<!-- field "TaskName" is string, type="string" (default) -->
<e-treegrid-column field="TaskName" headerText="Task Name" width="220"></e-treegrid-column>
<!-- field "StartDate" is DateTime, so type="date" with format -->
<e-treegrid-column field="StartDate" headerText="Start Date"
type="date" format="yMd" textAlign="Right" width="115"></e-treegrid-column>
<!-- field "Price" is decimal, type="number" with currency format -->
<e-treegrid-column field="Price" headerText="Price"
type="number" format="c2" textAlign="Right" width="100"></e-treegrid-column>
</e-treegrid-columns>
</ejs-treegrid>
❌ WRONG - Type Mismatch Issues:
// Bad model - mixing string where types should be specific
var badData = new List<TreeGridItem>
{
new TreeGridItem
{
TaskId = "1", // ❌ String instead of int
StartDate = "02/03/2024" // ❌ String instead of DateTime
}
};
// Result: Sorting fails, formatting doesn't work, expand/collapse issues
📄 Read: references/getting-started.md
Syncfusion.EJ2.AspNet.Core)_ViewImports.cshtml_Layout.cshtml<ejs-treegrid> declarationchildMapping / treeColumnIndex<e-treegrid-columns>actionFailure📄 Read: references/data-binding.md
childMapping (nested list) and idMapping/parentIdMapping (flat list)DataManager with OData/WebAPI adaptorexpandStateMapping — control initial expand/collapse state per row📄 Read: references/columns.md
field, headerText, textAlign, width, type, formattreeColumnIndex — which column shows expand/collapse arrowsshowCheckbox, autoCheckHierarchy)valueAccessor for computed/expression columnsshowColumnMenu)📄 Read: references/sorting.md
allowSortinge-treegrid-sortsettingsallowSorting: false on column)actionBegin, actionComplete)sortColumn / clearSorting📄 Read: references/filtering.md
allowFiltering📄 Read: references/editing.md
e-treegrid-editSettings and isPrimaryKeynewRowPosition: Top, Bottom, Above, Below, Child📄 Read: references/paging.md
allowPaginge-treegrid-pagesettings: pageSize, pageSizeMode (All/Root)dataBound event📄 Read: references/selection.md
e-treegrid-selectionsettings)checkboxMode📄 Read: references/aggregates.md
showChildSummary to show child aggregatefooterTemplate for custom display📄 Read: references/row.md
rowDataBound for conditional styling.e-altrow)allowRowDragAndDrop)📄 Read: references/cell.md
queryCellInfo for per-cell customizationallowTextWrap)📄 Read: references/excel-export.md
allowExcelExport, excelExport())📄 Read: references/pdf-export.md
allowPdfExport, pdfExport())📄 Read: references/print.md
allowPrintingprintMode: 'CurrentPage')📄 Read: references/clipboard.md
📄 Read: references/scrolling.md
📄 Read: references/adaptive.md
enableAdaptiveUI for mobile and tablet devices📄 Read: references/frozen.md
frozenRows, frozenColumns, or isFrozen property📄 Read: references/styling-and-appearance.md
📄 Read: references/immutable.md
enableImmutableMode="true"📄 Read: references/toolbar.md
📄 Read: references/context-menu.md
📄 Read: references/searching.md
📄 Read: references/loading-animation.md
📄 Read: references/global-local.md
locale property📄 Read: references/state-management.md
enablePersistence📄 Read: references/accessibility.md
📄 Read: references/properties-configuration.md
📄 Read: references/events-methods.md
📄 Read: references/classes-enums-reference.md
Minimal TreeGrid with local data, columns, sorting, filtering, and paging:
_ViewImports.cshtml
@addTagHelper *, Syncfusion.EJ2
_Layout.cshtml (inside <head>)
<!-- Syncfusion ASP.NET Core controls styles -->
<link rel="stylesheet" href="~/ej2/ej2version/fluent2.css" />
<!-- Syncfusion ASP.NET Core controls scripts -->
<script src="~/ej2/ej2version/dist/ej2.min.js"></script>
_Layout.cshtml (end of <body>)
<ejs-scripts></ejs-scripts>
Index.cshtml
@{
var data = TreeGridItems.GetTreeData();
}
<ejs-treegrid id="TreeGrid" dataSource="@data" childMapping="Children"
treeColumnIndex="1" allowSorting="true" allowFiltering="true" allowPaging="true">
<e-treegrid-pagesettings pageSize="5"></e-treegrid-pagesettings>
<e-treegrid-columns>
<e-treegrid-column field="TaskId" headerText="Task ID" isPrimaryKey="true"
textAlign="Right" width="95"></e-treegrid-column>
<e-treegrid-column field="TaskName" headerText="Task Name" width="220"></e-treegrid-column>
<e-treegrid-column field="StartDate" headerText="Start Date"
textAlign="Right" format="yMd" type="date" width="115"></e-treegrid-column>
<e-treegrid-column field="Duration" headerText="Duration"
textAlign="Right" width="100"></e-treegrid-column>
</e-treegrid-columns>
</ejs-treegrid>
Index.cshtml.cs (or Controller)
public class TreeGridItems
{
public int TaskId { get; set; }
public string TaskName { get; set; }
public DateTime StartDate { get; set; }
public int Duration { get; set; }
public List<TreeGridItems> Children { get; set; }
public static List<TreeGridItems> GetTreeData()
{
return new List<TreeGridItems>
{
new TreeGridItems
{
TaskId = 1, TaskName = "Planning",
StartDate = new DateTime(2021, 6, 7), Duration = 5,
Children = new List<TreeGridItems>
{
new TreeGridItems { TaskId = 2, TaskName = "Plan timeline", StartDate = new DateTime(2021, 6, 7), Duration = 5 },
new TreeGridItems { TaskId = 3, TaskName = "Plan budget", StartDate = new DateTime(2021, 6, 7), Duration = 5 }
}
}
};
}
}
childMapping vs idMappingchildMapping: Data is nested (each parent has a Children list) → bind childMapping="Children"idMapping + parentIdMapping: Data is flat with parent ID references → bind idMapping="TaskId" parentIdMapping="ParentId"<ejs-treegrid id="TreeGrid" dataSource="@data" childMapping="Children"
treeColumnIndex="1" toolbar="@(new List<string>() {"Add","Edit","Delete","Update","Cancel"})">
<e-treegrid-editsettings allowAdding="true" allowEditing="true"
allowDeleting="true" mode="Row"></e-treegrid-editsettings>
<e-treegrid-columns>
<e-treegrid-column field="TaskId" headerText="Task ID"
isPrimaryKey="true" width="90"></e-treegrid-column>
<e-treegrid-column field="TaskName" headerText="Task Name" width="220"></e-treegrid-column>
</e-treegrid-columns>
</ejs-treegrid>
Always set
isPrimaryKey="true"on one column — editing and delete operations require it.
isFrozen and frozenColumns at the same timeshowCheckbox column must be defined only on the tree columntextAlign="Right" is not applicable for the tree columnidMapping and childMapping simultaneouslycompletion-status.json (opens in a new tab)references/accessibility.md (opens in a new tab)references/adaptive.md (opens in a new tab)references/aggregates.md (opens in a new tab)references/cell.md (opens in a new tab)references/classes-enums-reference.md (opens in a new tab)references/clipboard.md (opens in a new tab)references/columns.md (opens in a new tab)references/context-menu.md (opens in a new tab)references/data-binding.md (opens in a new tab)references/editing.md (opens in a new tab)references/events-methods.md (opens in a new tab)references/excel-export.md (opens in a new tab)references/filtering.md (opens in a new tab)references/frozen.md (opens in a new tab)references/getting-started.md (opens in a new tab)references/global-local.md (opens in a new tab)references/immutable.md (opens in a new tab)references/loading-animation.md (opens in a new tab)references/paging.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub syncfusion/boldcreate-plugins --plugin syncfusion-aspnet-core66 skills in this plugin
/syncfusion-aspnetcore-3d-chartGuide for implementing Syncfusion 3D Chart in ASP.NET Core. Always use this skill when user needs 3D chart functionality, data visualization, series configuration, axes setup, or interactive chart features like tooltips and selection. Covers setup, data binding, chart types, styling, and user interactions./syncfusion-aspnetcore-accordionImplement Syncfusion Accordion component for organizing expandable navigation and content sections with single or multiple pane expansion support./syncfusion-aspnetcore-Other plugins' skills for the same job