Completed
Last Updated: 15 May 2025 08:46 by ADMIN
Matt
Created on: 01 May 2025 15:06
Category: UI for Blazor
Type: Feature Request
2
Support for GridColumn Field being used as a dictionary key

I have a scenario in which we have user definable columns for a grid, including hundreds if not thousands that need to be ported from the old version of our product. This means these column keys would be strings that may contain spaces or even special characters - and as such cannot be a valid C# property name (which means using an ExpandoObject approach will not work)

 

It would be really beneficial if the TelerikGrid component could be given Data of an IEnumerable<Dictionary<string, object>> where the Field property of GridColumn (or a new property) would line up with a key in that dictionary rather than a field name for the component to then use reflection with.

 

A customer with multiple modules of our product installed may very well have columns with similar names, i.e "Some Key", "SomeKey", "Some_Key", "Some & Key" - so simply replacing spaces or special characters may not always still give unique keys.

3 comments
ADMIN
Nadezhda Tacheva
Posted on: 15 May 2025 08:46

Hi Matt,

I believe this is a matter of misunderstanding and I apologize if this has caused any inconvenience on your end.

I will now update the status of the request to "Completed" as it is currently possible to configure the Grid to work with a collection of Dictionary<string, object> and use the keys for the columns.

Apart from that, if you are still experiencing issues with the Grid setup, you may open a dedicated support ticket, so we can revise it in detail. When doing so, please include an isolated runnable sample that replicates your current configuration and demonstrates the exact problem you are hitting. This will help us better understand the problem and ensure a faster resolution.

Regards,
Nadezhda Tacheva
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.

Matt
Posted on: 09 May 2025 21:25
Thanks for the information @Nadezhda - support had told me this was not possible and suggested I create a feature request. But regardless, I've been playing around with this approach, but it seems to be unable to render any data on the grid in this scenario. Yet it won't show the no data message either - so it has data, just cannot seem to render it.
ADMIN
Nadezhda Tacheva
Posted on: 08 May 2025 14:03

Hi Matt,

It is generally possible to configure the Grid to work with a collection of Dictionary<string, object>. We have such an example in this demo: https://demos.telerik.com/blazor-ui/grid/data-table.

Can you please revise and test it and let me know if you see any issues using this approach?

Regards,
Nadezhda Tacheva
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.