.net - How to display the members of a second Class in a Datagridview -


i have arraylist of objects (for example employees).

employee class properties:

  • name (string),
  • email (string),
  • telephone (string),
  • workgroup (workgroup)

the employee class has property workgroup, contains workgroup-object:

workgroup class properties:

  • name (string),
  • email (string)).

i tried display values , set datapropertyname of columns these values:

  • "name",
  • "email",
  • "telephone",
  • "workgroup.name",
  • "workgroup.email".

but did not work workgroup-properties.

is there simple way without writing wrapper-class, exposes properties of employee , workgroup?

i have many objects similar relationships in project , want migrate datatables native sql object-relational-mapper nhibenate. expensive write additional mapper-classes views. i'm programming in java eclipse , there can solve problem using interface itablelabelprovider.

friend class employee     public name string     public phone string     public email string     private oworkgroup workgroup      public property workgroupemail string                     return oworkgroup.email         end         set(value string)             oworkgroup.email = value         end set     end property     public property workgroupname string                     return oworkgroup.name         end         set(value string)             oworkgroup.name = value         end set     end property end class 

will work you? create properties display workgroup properties


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -