Mewriick / Blazor.FlexGrid

GridView component for Blazor
MIT License
199 stars 35 forks source link

Binding to list of Expando objects #117

Open MAndrade1980 opened 3 years ago

MAndrade1980 commented 3 years ago

Hi, have you ever tried binding the grid to a list of expando objects? Seems it throws an error, not sure if it's an issue using reflection getting properties of the object to bind the columns. We were not explicitly setting any property configs and hoping it would render all dynamic properties as columns but seems to fail when binding. I see other grid components binding to this type of object, was seeing if it was something you had tried.

https://docs.microsoft.com/en-us/dotnet/api/system.dynamic.expandoobject?view=net-5.0

Mewriick commented 3 years ago

Hello, I know where is the problem but I am not sure if I want to support this kind of scenario. For now is not easy way how to implement this because whole idea of configuration and other internal stuff is based on PropertyInfo. I can write own object which can represent this object for expando object. The problem is that now some internal stuff in constructed before items are binded, and for ExpandoObejct this is problem because I first need some item and after that I can construct PropertyInfo for properties.

Generally I like ideas of Dto objects so I do not consider this behaviour in the beginning. I will consider some kind of support at least for rendering but it requires a little bit more time.