binding a grid to a collection of custom objects

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I'm sorry for my english...

I have a clas that contains a variable number of data stored in a
dictionary. The key of the dictionary is a string that defines the name of
the field.

( varA 12
varB "a string"
varC 12/12/98
.....)

I need to create a binding between a grid and a collection of objects of
this class and have the variables varA, varB, varC as column fields (not the
public properties of the class...)

Any ideas? ICustomTypeDescriptor ? if so, how can i do this?

thanks....
 
Pallet,

I wouldn't recommend implementing ICustomTypeDescriptor on the object
directly, as could cause problems in other areas where reflection is used on
it. Rather, I would implement this interface on another class, and have
that class take a reference to each instance of your object. That other
class would then be responsible for returning the properties based on what
is in your collection (through the implementation of the GetProperties
method).

Hope this helps.
 
Back
Top