Column spanning in TypeScript Grid control
18 Nov 20181 minute to read
The column spanning feature in the Syncfusion® Grid allows you to merge adjacent cells horizontally, creating a visually appealing and informative layout. By defining the colSpan attribute in the queryCellInfo event, you can easily span cells and customize the appearance of the grid.
In the following demo, Employee Davolio doing analysis from 9.00 AM to 10.00 AM, so that cells have spanned.
Change the border color while column spanning
You can change the border color for the spanned cells by the using queryCellInfo event. This event triggers before the cell element is appended to the Grid element.
Limitations
- The updateCell method does not support column spanning.
- Column spanning is not compatible with the following features:
- Virtual scrolling
- Infinite scrolling
- Grouping
- Autofill
Column spanning using enableColumnSpan property
The Syncfusion Grid introduces a simplified approach to horizontally merge cells using the enableColumnSpan property.
When the enableColumnSpan property is enabled, the Grid automatically merges cells with matching data across adjacent columns without requiring manual span configuration using the queryCellInfo event. These merged cells are visually combined into a single cell, improving readability.
Here is an example of how to use the enableColumnSpan property to merge cells horizontally:
You can also control spanning at the column level. To prevent merging for specific columns, set
enableColumnSpanto false in the column definition.
Limitation
- Virtualization
- Infinite Scrolling
- Lazy Load Grouping
- Row Drag and Drop
- Column Virtualization
- Detail Template
- Editing
- Export
- Foreign Key
- Hierarchy Grid