This is a migrated thread and some comments may be shown as answers.

PropertyBag

2 Answers 105 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 20 Feb 2018, 06:18 PM

Hello,

I'm binding objects to a GridView, but i need to create properties for my objects at runtime, because I won't know what properties the object has or how many.  (This is a plugin for Autodesk Revit.)  I was able to implement the PropertyBag method here which is working https://www.codeproject.com/Articles/12282/Implementing-a-PropertyBag-in-C  But the GridView just sees "PropertyBag" as one of the properties.  I'm trying to figure out how to get (or if) the GridView to read these 'subproperties'.  I can create columns for each property in runtime but the cells are blank.  Or if it makes sense to set the cell value of the row based on the column's name.  Thanks.

2 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 21 Feb 2018, 09:33 AM
Hi Michael,

I believe that the best solution for dynamic data would be to use RadVirtualGrid. This way you can dynamically pass the data to the grid when needed. I have prepared a small example that used the PropertyBag and shows the data in the grid. I have updated the PropertyBag class a bit as well (to use integer indexes).  

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Michael
Top achievements
Rank 1
answered on 21 Feb 2018, 02:51 PM
Thanks for the quick response Dimitar,  I will try it out and let you know how it goes.
Tags
GridView
Asked by
Michael
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Michael
Top achievements
Rank 1
Share this question
or