﻿<?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 » WinForms (How do I?)  » BBS issue</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 14:38:16 GMT</lastBuildDate><ttl>20</ttl><item><title>BBS issue</title><link>http://forum.strataframe.net/FindPost32220.aspx</link><description>Scenario:&lt;br/&gt;&lt;br/&gt;DataGridView with BBS as its datasource, BBS BO set to a BO on my form. All works fine when DataGridView is on the form.&amp;nbsp;If I move the datagridview into a container (ThemedContainer) and it no longer syncs.&lt;br/&gt;&lt;br/&gt;Why and how to fix please?</description><pubDate>Fri, 27 Sep 2013 11:07:46 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: BBS issue</title><link>http://forum.strataframe.net/FindPost32222.aspx</link><description>That worked, thanks.</description><pubDate>Fri, 27 Sep 2013 11:07:46 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: BBS issue</title><link>http://forum.strataframe.net/FindPost32221.aspx</link><description>Ok, Keith, I finally got this one figured out. &amp;nbsp;Something, I have no idea what, is accessing the BindingContext of the ThemedContainer in the setup and loading of the form before the form's BindingContext is created, so the ThemedContainer just creates its own BindingContext. &amp;nbsp;Any other control on the form that doesn't have its own BindingContext uses its parent's, which cascades up to the form's BindingContext. &amp;nbsp;The BindingContext is the object that creates the CurrencyManager, which controls the currently selected item. &amp;nbsp;So, by having the DataGridView in a ThemedContainer, it is using a different CurrencyManager because it has a different BindingContext.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Luckily for us, BindingContext is not read-only :)&lt;br/&gt;&lt;br/&gt;&lt;div&gt;So, adding the following line of code right after the InitializeComponent() call in the constructor fixes it.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&lt;div&gt;public Form1()&lt;div&gt;{&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;InitializeComponent();&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;this.themedContainer1.BindingContext = this.BindingContext; //&amp;lt;-- This line sets the BindingContext of the ThemedContainer back to the BindingContext of the form&lt;div&gt;}&lt;br/&gt;&lt;br/&gt;&lt;div&gt;That should get you fixed.</description><pubDate>Fri, 27 Sep 2013 10:28:24 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>