The class that will contain the properties will be part of a collectionof
class that will be bound to a datagridview. I do know where the value are
coming from but not the names or how many will be coming in. These values
are 'roles' that can be given to a user. Its a many-to-many relationship so
the user need to be assigned multiple roles. But each group will have its
own control over the names of and number of roles that in their group. That
is a requirement.
I have something programmatically creates a dataset, populates it with the
users collection, appends each role as a column and then sets a value for
that user role if it listed in the lookup table. That datatable is then
bound to the datagridview. However I was told that I need make bindable
object for the UI guy to attach too so they can configure it all through the
designed and not write it all in the code behind page.
I was doing some research into Reflection but I have to admit that I have no
experience in using it.
>> I am new to dotnet and I'll tried searching Google for a solution to
>> my problem. I am hoping that it is possible to do, or am I going
[quoted text clipped - 12 lines]
>
> Armin
Armin Zingler - 29 Sep 2007 00:09 GMT
> The class that will contain the properties will be part of a
> collectionof class that will be bound to a datagridview. I do know
[quoted text clipped - 15 lines]
> I was doing some research into Reflection but I have to admit that I
> have no experience in using it.
I know nothing about the datagridview because I'm not a friend of data
binding and late binding at all, so unfortunatelly I can not help you with
this.
I would add the values to a Hashtable or any kind of name/value collection
maintained by the User class. Maybe somebody else knows a way to dynamically
bind these values as additional columns to the datagridview. IMO better than
dynamically creating extended classes using Reflection. Though, I don't know
what's the best way, sorry.
Armin
Dennis - 29 Sep 2007 01:10 GMT
You can use reflection to both get and set properties of a class based on the
property name.

Signature
Dennis in Houston
> The class that will contain the properties will be part of a collectionof
> class that will be bound to a datagridview. I do know where the value are
[quoted text clipped - 30 lines]
> >
> > Armin
Armin Zingler - 29 Sep 2007 02:25 GMT
> You can use reflection to both get and set properties of a class
> based on the property name.
I think the problem is that the property does not exist yet and is to be
added at runtime.
Armin
Dennis - 29 Sep 2007 02:48 GMT
Guess I didn't understand the question. Kind of hard to add a property at
run time but guess is possible with some inline runtime coding but way beyond
my expertese.

Signature
Dennis in Houston
> > You can use reflection to both get and set properties of a class
> > based on the property name.
[quoted text clipped - 3 lines]
>
> Armin