• What is KendoReact
  • Getting Started
  • Unstyled Mode
  • Server Components
  • Components
  • Sample Applications
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Changelog
  • Updates
  • Troubleshooting

Implement expand/collapse in Grid with flat data without grouping

Environment

Product Version5.12.0
ProductProgress® KendoReact

Description

I have flat data and I want to add expand/collapse functionality for hiding a given set of items by some custom condition.

Solution

Add a column with custom "cell" for rendering the expand/collapse icons. Within the Grid's rowRender the 'child' items visibility can be determined by the custom logic in which the items are 'grouped'.

Following is an example demonstrating how to simulate hierarchy with flat data where the order of the items in the 'data' are in the correct order and the parent items have ParentID equal to 0.

Example
View Source
Change Theme:

In this article

Not finding the help you need?