StrataFrame Forum

Parent/Child Relationship through Listview

http://forum.strataframe.net/Topic22146.aspx

By Philipp Guntermann - 3/2/2009

Hi,

scenario:

  • Table PropertyGroups:
    • ID
    • Name
    • Comment
  • Table Properties
    • ID
    • Name
    • PropertyGroups_ID
    • Comment

I have Maintanance form to add and modify the propertygroups allready.

Now on the Maintance form for the Properties, i'd have:

  • Textfield: Name
  • Combobox: PropertyGroup
  • Textfield: Comment

What i need is for the Combobox to allow selection of anyone of the Property-Groups from the PropertyGroups Table/BO, and saving the selected PK/ID from that Property Group into to Propertie-Table/BO PropertyGroups_ID column.

what is the proposed way to achieve that ?

thanks.

By Trent L. Taylor - 3/3/2009

I guess I am a bit confused.  From what I understand, it would just be a matter of populating a combo with the PropertyGroups and the binding to the PropertyGroups_Id on the child table....please let me know what piece I am missing or if this is what you were looking for.
By Philipp Guntermann - 3/3/2009

hi,

yes this is what i am looking for.

i have a PropertyGroupsBO and a PropertiesBO. each one has a fill method.

They user shoud select a property group from the combobox (the propertygroup's name),
and then it should save that to the PropertiesBO.PropertyGroups_ID field. (the pk_id of the selected property group).

By Edhy Rijo - 3/3/2009

Hi Philipp,

See the picture attached that will give you a clear idea of how to setup your combobox.  In this case I have a method called FillAllRecords() in my BO base class and since I want to show all records in the combo, I chose that method then, set the lookup bo PK field in the Value Member to be updated in your main table.

By Philipp Guntermann - 3/3/2009

hi !

thanks for the screenshot. so i set the list population like on the screenshot in my case using PropertyGroupsBO and then i set the BusinessObject-Property of the combobox to Properties, i guess ?

By Edhy Rijo - 3/3/2009

Philipp Guntermann (03/03/2009)
... in my case using PropertyGroupsBO and then i set the BusinessObject-Property of the combobox to Properties, i guess ?

Yes, and you use bind the combo to the FK field in the PropertiesBO.

By Philipp Guntermann - 3/3/2009

that makes sense. Thanks for your explanation.

gonna try that tommorow BigGrin