Say we have this structure in db, with almost none properties. All properties, their name, default value, description and type (string, integer, datetime) are defined in one table (attributeDefinition), and all values are stored in another table.
Cars (Id, Name)
AttributeDefinition(AttributeDefinitionId, Type, Name, Desctiption, MaxValue, ...)
AttributesValues (AttributeDefinitionId, CarId, Value)
Now I want to create a generic editor for the Cars properties.
Question is, how should I implement this? Are there some build in controls that can handle this, are there something similar other have been doing?
Or should I just go like this:
// In MyPropertyEditor.ascx load
// Iterate over all attributes in attributedefinition
// add TextBox, NumberEditor or DateTimePicker,
// give them som good names
// End
//
// In Save, iterate over all controls again, and save back
Am I heading in the right direction?
I was thinking about the datagrid, and how it creates all the columns on the fly. I was hoping I could do something similar?
Thanks for any help
Regards
Larsi