Grid Custom Cells

0 Answers 32 Views
Grid
Andrei
Top achievements
Rank 1
Iron
Andrei asked on 10 Jun 2025, 02:31 PM | edited on 19 Jun 2025, 03:39 PM
Hi!

I'm using a grid component with custom cells 11.0.0 version. I am providing a simplified version of the grid that I need. Namely: A grid with custom grid cells and header cells. 

1. The resizable of the custom header cell (ProductName) does not work.
2. The custom column cell (cells={{data: MyColumnCustomCell}}) completely redefines the custom grid cell (cells={{data: MyDataCustomCell}}). In the example, this is the ProductName column. But I need it to be inherited from the grid cell. In version 5.15.0, where the grid accepted cellRender, I could redefine the cells in cellRender, but the custom column cell was still inherited from cellRender. And the cell was still highlighted in bold without explicitly specifying the style in the column cell. How can this be done now?
The option to duplicate the style (fontWeight: bold ? 'bold' : 'inherit') in a custom column cell is not suitable for me due to the individual implementation of the grid.

https://stackblitz.com/edit/react-ag2bjt6h?file=app%2Fapp.tsx
Filip
Telerik team
commented on 23 Jun 2025, 01:06 PM

Hello, Andrei,

Thank you for the provided example.

I examined it and I can suggest using children since it includes all default behavior like resizing. Custom rendering must either replicate that behavior fully or defer to the default structure. I have modified the previously sent example and it seems that now resizing work as expected:

Please review the approach above and let me know in case this is still not what you are looking for and I will gladly assist further.

Regards,
Filip

Andrei
Top achievements
Rank 1
Iron
commented on 24 Jun 2025, 07:40 AM

Hi!
Thanks for the decision. But if the cell should contain only an image (without transferring children to a custom header cell), then your option stops working.

And can you give an answer on the second point please (about custom cells in the grid and column).
Thanks
Filip
Telerik team
commented on 26 Jun 2025, 07:12 AM

Hello, Andrei,

Thank you for the clarification. I did some tests with the custom header cells and you are right, if text is missing the resizing does not work. This seems to be by design, if no text is present the Grid never wires up the drag-handle.

As for the second point there is currently no built-in API for automatic "inheritance" between Grid-level and column-level cells. When a column defines its own cells.data, it fully replaces the Grid-level cell logic for that column. 

If possible can you please send me a runnable example which matches your older implementation with cellRender? I can modify it directly to make it work with the latest version.

Regrads,
Filip

Andrei
Top achievements
Rank 1
Iron
commented on 26 Jun 2025, 12:58 PM

Hello, Filip!

What solution can you suggest in this situation, when only an image without any text is displayed in the custom header cell?

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Andrei
Top achievements
Rank 1
Iron
Share this question
or