Generic type support for dataItem in components (Eg: Grid)

1 Answer 22 Views
General Discussions Grid
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Grant asked on 20 Nov 2025, 01:20 PM

Hi team,

I'm working with KendoReact Grid and need to strongly type the `dataItem` property in custom cell components. Currently, `GridCustomCellProps` has `dataItem: any`, which loses type safety.

I've been creating wrapper types like:

// Base generic type for any Kendo component with dataItem
type WithTypedDataItem<K, D> = Omit<K, 'dataItem'> & { dataItem: D };

// Specific type aliases for common use cases
type TGridCustomCellProps<T> = WithTypedDataItem<GridCustomCellProps, T>;
// ... others

Questions:
1. Is there a native/commonly accepted way to type `dataItem` that I'm missing?
2. Are there plans to add generic type parameters to `GridCustomCellProps` (e.g., `GridCustomCellProps<TDataItem>`) in future releases?

This would improve type safety across Grid, ComboBox, DropDownList, and other components that use dataItem.

Thanks,
Grant

1 Answer, 1 is accepted

Sort by
0
Yanko
Telerik team
answered on 24 Nov 2025, 11:34 AM

Hello, Grant,

Yes, you are correct that components like Grid, ComboBox, and DropDownList do not expose generic type parameters for dataItem. This design provides high flexibility, letting developers plug in diverse data models without strict type constraints.

The approach you are using, creating wrapper types, is a common solution in TypeScript projects, which enables you to enforce type safety for your custom cell components, and it is the suggested approach in this scenario.

As for the future, there is an open feature request in our public feedback portal and an open GitHub issue about native generic support. However, this is still in an unplanned stage. For your convenience, I added your vote to it to increase the popularity of the request:

If further questions arise, please do not hesitate to ask.

Regards,
Yanko
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
General Discussions Grid
Asked by
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Yanko
Telerik team
Share this question
or