<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Problems with nested proprerty and databinding</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Problems with nested proprerty and databinding</description>
  <pubDate>Fri, 12 Jun 2026 08:39:39 -700</pubDate>
  <lastBuildDate>Mon, 09 Jul 2007 08:56:27 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=108</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Problems with nested proprerty and databinding : Dominique,  If you look at the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=108&amp;PID=247#247</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=23" rel="nofollow">davidklitzke</a><br /><strong>Subject:</strong> 108<br /><strong>Posted:</strong> 09-Jul-2007 at 8:56am<br /><br />Dominique,<DIV>&nbsp;</DIV><DIV>If you look at the intermediate tutorial "264. - Working with ComboBoxes", you'll find a good example of using the Null Entity with a ComboBox.&nbsp; In this tutorial, the Null Entity is used as one of the possible choices for Manager (since not every Employee may have a Manager - e.g., president of the company, Employee whose manager just left the company).&nbsp; Note that in this tutorial, the Null Entity is added to the EntityList for Managers:</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;mManagers = mPM.GetEntities&lt;Employee&gt;();<BR>&nbsp;mManagers.Add(mPM.GetNullEntity&lt;Employee&gt;());<BR>&nbsp;mManagerSource.DataSource = mManagers;</DIV>]]>
   </description>
   <pubDate>Mon, 09 Jul 2007 08:56:27 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=108&amp;PID=247#247</guid>
  </item> 
  <item>
   <title>Problems with nested proprerty and databinding : Hi, I found your post on the news...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=108&amp;PID=245#245</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=60" rel="nofollow">Dominique</a><br /><strong>Subject:</strong> 108<br /><strong>Posted:</strong> 07-Jul-2007 at 1:58pm<br /><br />Hi,<br />I found your post on the news group just before checking here :-). Any way, thanks fo your attention.<br />I see how It would work if "Each SalesOrder has an asssociated Province and City". In my case it's more "Each SalesOrder might have an asssociated City and Each City has an asssociated Province".<br /><br />i.e. SalesOrder.City and SalesOrder.City.Province, and City can be the NullEntity. <br />This last point leads to the city being the nullentity each time the province is changed (and might also give some "updating the nullentity" messages, but I can't remember for sure). It could work by selecting the first city wich is not the nullentity in the refreshed list, It would be a hack but I guess it would get the work done. <br /> <br />I actually gave up using databinding for the combos and handle them "manually". <br /><br />Dominique<br />]]>
   </description>
   <pubDate>Sat, 07 Jul 2007 13:58:55 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=108&amp;PID=245#245</guid>
  </item> 
  <item>
   <title>Problems with nested proprerty and databinding : Here is something that I posted...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=108&amp;PID=239#239</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=23" rel="nofollow">davidklitzke</a><br /><strong>Subject:</strong> 108<br /><strong>Posted:</strong> 06-Jul-2007 at 2:23pm<br /><br /><P =Ms&#111;normal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Here is something that I posted on the IdeaBlade NewsGroup last winter on how to populate ComboBoxes when the list of entities in the ComboBox changes as the result of the currently selected item in some other ComboBox.<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">A Customer asked:</P><DIV></SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">On my windows form I have a drop down with our country's Provinces and<BR>i have a drop down of cities, the cities have a relationship in the<BR>Database with the Provinces, I'm wondering now how can I get the<BR>cities to only show those linked to a specific province when this one<BR>is selected?<o:p></o:p></SPAN></FONT></DIV><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I&nbsp;replied:<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=blue size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">I will show how to do this with a form that edits SalesOrders.&nbsp; Each SalesOrder has an <?:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:place w:st="&#111;n"><st1:PlaceName w:st="&#111;n">asssociated</st1:PlaceName> <st1:Place w:st="&#111;n">Province</st1:place></st1:place> and City.&nbsp; As you stop on a particular SalesOrder, the ComboBox for Cities will show you only cities for that Province.&nbsp; If you select a different province from the Province ComboBox, the ComboBox for Cities will immediately display all of the cities from the new province.</SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=blue size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Here is how to do this:</SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=blue size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">(1)&nbsp;&nbsp;&nbsp; Using the designer for the ControlBindingManager, create a ComboBox for SalesOrder.Province. &nbsp; Populate the EntityList for this ComboBox with the list of all Provinces.<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=blue size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=blue size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">(2)&nbsp;&nbsp;&nbsp; Using the designer for the ControlBindingManager, create a ComboBox for SalesOrder.Cities. &nbsp; Populate the EntityList for this ComboBox, not with all of the Cities in the Citiy Table, but rather&nbsp;with the list of all Cities that are in the currently selected Province..<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=blue size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=blue size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">(3)&nbsp;&nbsp;&nbsp; Create an event handler for the BindingSource.CurrentChanged of SalesOrder.&nbsp; Record the identity of the current SalesOrder (i.e., lastSalesOrder)<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=blue size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=blue size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">(4)&nbsp;&nbsp;&nbsp; Create an event handler for the BindingSource.CurrentChanged of Province.&nbsp; This event handler needs to populate the EntityList for&nbsp;Cities when the CurrencyManager changes its position.&nbsp; There are two cases.&nbsp; The first case is when we are moving from SalesOrder to SalesOrder.&nbsp; This requires repopulating the EntityList with Province.Cities from the new Province in the new SalesOrder.&nbsp; The second case is when when we are changing the&nbsp;Province in the current SalesOrder.&nbsp; This requires repopulating the EntityList with Province.Cities from the newly selected&nbsp;Province in the ComboBox.&nbsp; In addition, we must choose a new SalesOrder.City value.&nbsp; We don't know which City to pick, so we just pick the first one.&nbsp; We decide whether we are in case 1 or case 2 by comparing the current SalesOrder to lastSalesOrder</SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>]]>
   </description>
   <pubDate>Fri, 06 Jul 2007 14:23:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=108&amp;PID=239#239</guid>
  </item> 
  <item>
   <title>Problems with nested proprerty and databinding : Hi,  I&amp;#039;m still strugling...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=108&amp;PID=236#236</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=60" rel="nofollow">Dominique</a><br /><strong>Subject:</strong> 108<br /><strong>Posted:</strong> 05-Jul-2007 at 9:54am<br /><br />Hi,<br /><br />I'm still strugling to databind my combos. It did worked earlier today but not any more now as I should go home. <br /><br /> * I have a structure looking like:<br /> Person -&gt; City -&gt; Country <br /> * I have the following UI:<br />the details of a persons are presented with loose controls<br />a datagridview presents a list of person with a summary including city/coutry as readonly textboxes<br />They share the same bindingSource object<br /><br /> * would it be possible to do the following with databinding:<br /><br />1&gt; user updates a Person entity in the details view<br />the user chooses a country -&gt; update the list of cities<br />the user choose a city -&gt; update Person.city<br /><br />2&gt; user navigates through the person list by selecting a row in the datagridview<br />the combos display the right country/city &lt;- ok <br /><br />3&gt; the model changes (from another screen)<br />the combos display the right country/city&nbsp;&nbsp;&nbsp;&lt;- ok<br />the readonly textboxes in the gridview are updated &lt;- almost (I need to listen to the listChanged event and tell the grid to refresh itself, I buy any better way here :-)<br /><br />I can handle the combos manually (done that on one screen) but it would be sweet to do it with databinding<br /><br />Dominique<span style="font-size:10px"><br /><br />Edited by Dominique - 05-Jul-2007 at 9:58am</span>]]>
   </description>
   <pubDate>Thu, 05 Jul 2007 09:54:45 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=108&amp;PID=236#236</guid>
  </item> 
 </channel>
</rss>