﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Issues  » problem with BBS &amp; standart .NET grid</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 08:33:04 GMT</lastBuildDate><ttl>20</ttl><item><title>problem with BBS &amp; standart .NET grid</title><link>http://forum.strataframe.net/FindPost31872.aspx</link><description>Hi folks :&lt;br/&gt;&lt;br/&gt;&lt;div&gt;I have a problem with BBS &amp;amp; standart .NET grid.&lt;div&gt;&lt;span style="font-size: 12px;"&gt;I have 2 BO on a form ... Let Say ParentBO and ChildBO...&lt;/span&gt;&lt;div&gt;&lt;span style="font-size: 12px;"&gt;As the names&amp;nbsp;implys one is parent and other is child.&lt;/span&gt;&lt;div&gt;&lt;span style="font-size: 12px;"&gt;I setup&amp;nbsp;ParentRelationship and&amp;nbsp;ParentBusinessObject properties of these BO's properly as i always do.&lt;/span&gt;&lt;div&gt;&lt;span style="font-size: 12px;"&gt;I also setup the BBS and grid as in SF Help document (Topic :&lt;/span&gt;&lt;span style="font-size: 12px;"&gt;Understanding the Business Binding Source (BBS) Control)&lt;/span&gt;&lt;div&gt;&lt;span style="font-size: 12px;"&gt;When I call ParentBO's Save I got a exception from SF's internal method&amp;nbsp;PushDataToChildren.&lt;/span&gt;&lt;div&gt;&lt;span style="font-size: 12px;"&gt;When ı debug the problem i noticed that there is a one parent BO (ParentBO) but more then one child BO (which i never declared).&lt;/span&gt;&lt;div&gt;&lt;span style="font-size: 12px;"&gt;And these extra child BO's ParentRelationship was nothing...&lt;/span&gt;&lt;div&gt;&lt;span style="font-size: 12px;"&gt;&lt;br/&gt;&lt;/span&gt;&lt;div&gt;This is first time I am using BBS...&lt;br/&gt;&lt;br/&gt;&lt;div&gt;When i worked on BBS deeply, I have also noticed that BBS ınternally, create an BO of same type for each row.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;And I also noticed the problem is those Child BOs which internally added by BBS in SF.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Is this normal working logic of BBS?&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Am i missing something in this picture?&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Please advice ...&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Kind regards...</description><pubDate>Fri, 01 Mar 2013 21:07:54 GMT</pubDate><dc:creator>hector</dc:creator></item><item><title>RE: problem with BBS &amp; standart .NET grid</title><link>http://forum.strataframe.net/FindPost31901.aspx</link><description>&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Problem is solved Ben...&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Thanks a lot indeed&lt;br/&gt;&lt;br/&gt;&lt;div&gt;You are great:)</description><pubDate>Fri, 01 Mar 2013 21:07:54 GMT</pubDate><dc:creator>hector</dc:creator></item><item><title>RE: problem with BBS &amp; standart .NET grid</title><link>http://forum.strataframe.net/FindPost31886.aspx</link><description>&lt;br/&gt;&lt;br/&gt;&lt;div&gt;You are right Ben..&lt;br/&gt;&lt;br/&gt;&lt;div&gt;I did so..&lt;br/&gt;&lt;br/&gt;&lt;div&gt;I will try your sugession and let u know...&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Thanks a lot</description><pubDate>Wed, 27 Feb 2013 20:09:24 GMT</pubDate><dc:creator>hector</dc:creator></item><item><title>RE: problem with BBS &amp; standart .NET grid</title><link>http://forum.strataframe.net/FindPost31882.aspx</link><description>OK, I think I have an idea... the ParentRelationship is generally set through the type editor on the business object component editor. &amp;nbsp;That means that the definition for the ParentRelationship gets put into the InitializeComponent() of the business object. &amp;nbsp;Any time you create a new instance of the business object type, it should already have the ParentRelationship set. &amp;nbsp;Are you setting the parent relationship a different way, such as setting it explicitly on the form?&lt;br/&gt;&lt;br/&gt;&lt;div&gt;To fix it, I can do a build for you or if you are comfortable with building the source yourself, the CreateShareAndAddBusinessObject() method needs to be changed to this:&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Private Function CreateShareAndAddBusinessObject(ByVal index As Integer) As BusinessLayer&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '-- Create a new object&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim loReturn As BusinessLayer = CType(Activator.CreateInstance(Me._BusinessObject.GetType()), BusinessLayer)&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '-- Share the table&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Me._BusinessObject.ShareCurrentDataTable(loReturn)&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;strong&gt;'-- Set the parent relationship in case it was set on the business object explicitly outside of the constructor&lt;/strong&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;strong&gt;If loReturn.ParentRelationship Is Nothing Then&lt;/strong&gt;&lt;div&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; loReturn.ParentRelationship = Me._BusinessObject.ParentRelationship&lt;/strong&gt;&lt;div&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '-- Set the parent business object of the instance object&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; loReturn.ParentBusinessObject = _BusinessObject.ParentBusinessObject&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '-- Add the object to the list&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Me._BusinessObjectList.Add(index, loReturn)&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '-- Return the new object&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return loReturn&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Function</description><pubDate>Wed, 27 Feb 2013 07:51:36 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: problem with BBS &amp; standart .NET grid</title><link>http://forum.strataframe.net/FindPost31875.aspx</link><description>Hi Ben,&lt;br/&gt;&lt;br/&gt;&lt;div&gt;As I can see the problem is &amp;nbsp;here in this private method in ..\MicroFour StrataFrame Business\business\BusinessBindingSource.vb&amp;nbsp;:&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&lt;div&gt;&amp;nbsp;Private Function CreateShareAndAddBusinessObject(ByVal index As Integer) As BusinessLayer&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '-- Create a new object&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim loReturn As BusinessLayer = CType(Activator.CreateInstance(Me._BusinessObject.GetType()), BusinessLayer)&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '-- Share the table&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Me._BusinessObject.ShareCurrentDataTable(loReturn)&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '-- Set the parent business object of the instance object&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font size="2"&gt; &amp;nbsp; &amp;nbsp;&lt;/font&gt;&lt;span style="background-color: rgb(255, 221, 0);"&gt; &lt;font size="2" style="color: rgb(255, 0, 0);"&gt;loReturn.ParentBusinessObject = _BusinessObject.ParentBusinessObject &amp;nbsp;'-&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/font&gt;&lt;font color="#ff0000"&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="1"&gt;&lt;strong&gt;In this line setting ParentBusinessObject increase &amp;nbsp;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font size="1" color="#ff0000"&gt;&lt;strong&gt;ChildBusinessObjects collection and when parent BO calls save method there are lot of child BO to be save and their&amp;nbsp;ParentRelationship property is nothing&lt;/strong&gt;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '-- Add the object to the list&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Me._BusinessObjectList.Add(index, loReturn)&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '-- Return the new object&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return loReturn&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Function&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Thanks Ben</description><pubDate>Tue, 26 Feb 2013 01:26:44 GMT</pubDate><dc:creator>hector</dc:creator></item><item><title>RE: problem with BBS &amp; standart .NET grid</title><link>http://forum.strataframe.net/FindPost31874.aspx</link><description>[quote][b]Ben Chase (2/25/2013)[/b][hr]... I'm sure you'll probably be one of our first beta users when we post it.[/quote]&lt;br/&gt;Hi Ben,&lt;br/&gt;Count me in, been waiting for SF2.0 for a long time&amp;lt;smile!!!&amp;gt;</description><pubDate>Mon, 25 Feb 2013 23:37:04 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: problem with BBS &amp; standart .NET grid</title><link>http://forum.strataframe.net/FindPost31873.aspx</link><description>Nope, you're not missing anything from the picture. &amp;nbsp;The foremost limitation of the SF BusinessObjects is that they are a single object that contains many actual records. &amp;nbsp;One class and one instance contains multiple records, but the BO only talks to one record at a time. &amp;nbsp;It was designed this way to be similar to the way some older programming languages work. &amp;nbsp;However, with .NET, it's an issue because .NET expects collections for data sources, and a BO is only a single object. &amp;nbsp;So, the BO has to try to act like both a single object and a group of objects as well. &amp;nbsp;That's why we created the BBS. &amp;nbsp;It wraps a BO and turns it into a collection of instances. They all share their internal data table behind the scenes so they each behave like they are the same business object, but each is pointed to a specific row. &amp;nbsp;Since all of the children share the same internal DataTable, they don't all need to be children of the parent, just one of them does... the original one you linked up in your code. &amp;nbsp;I'll have to take a look at this and see why the ParentBusinessObject reference is getting set on all of the child objects.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;FYI, this was the &lt;span style="text-decoration: underline;"&gt;first&lt;/span&gt; item on our list of enhancements for SFv2; separate objects and collections. &amp;nbsp;We use an entity model with multiple classes instead of shoehorning all logic into one class: Entity, EntityCollection, EntityWinFormsView, EntityWpfView, EntityWebView, etc. &amp;nbsp;I'm sure you'll probably be one of our first beta users when we post it.</description><pubDate>Mon, 25 Feb 2013 23:19:42 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>