<?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 : Combobox binding</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Combobox binding</description>
  <pubDate>Fri, 17 Apr 2026 14:19:59 -700</pubDate>
  <lastBuildDate>Sun, 02 Sep 2007 11:54:01 -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=383</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>Combobox binding : Thanks a lot for your help.......</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=383&amp;PID=1043#1043</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=130" rel="nofollow">jcdk</a><br /><strong>Subject:</strong> 383<br /><strong>Posted:</strong> 02-Sep-2007 at 11:54am<br /><br />Thanks a lot for your help.... I've got it now.<DIV>&nbsp;</DIV><DIV>I am impressed by the level of support you deliver at IdeaBlade. That tells me that the decision to use DevForce for our development project is correct.</DIV><DIV>&nbsp;</DIV><DIV>Thanks again&nbsp;&nbsp; <img src="http://www.ideablade.com/forum/smileys/smiley20.gif" height="17" width="23" border="0" align="absmiddle" alt="Thumbs%20Up" /></DIV><DIV>Jesper Carstensen</DIV>]]>
   </description>
   <pubDate>Sun, 02 Sep 2007 11:54:01 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=383&amp;PID=1043#1043</guid>
  </item> 
  <item>
   <title>Combobox binding : You are most of the way there.  Assuming...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=383&amp;PID=1028#1028</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=43" rel="nofollow">pkarsh</a><br /><strong>Subject:</strong> 383<br /><strong>Posted:</strong> 29-Aug-2007 at 1:00pm<br /><br />You are most of the way there.<br /><br />Assuming that you have defined a relation between ContactPerson and Order, where ContactPerson is the parent object, then in the ControlBindingManager you should see a "ContactPerson" property.  If you drag that property onto the Autopopulation pane it should specify a ComboBox as the best fit control for that property.  The DataConverter for that property should be specified as a ListConverter.  You then have to configure the ListConverter.<br /><br />To do that, click on the rightmost button on that row, next to the DataConverter column.  A "ListConverter properties" property sheet should appear.  If you do not already have a BindingSource to populate a ComboBox of ContactPersons on your form (as I would assume that you do not), click the "Create List" button at the bottom of this property sheet.  A dialog box will appear to allow you to enter the name of a new BindingSource that will be created and added to the form.  Fill in something on this form, then select the DisplayMember of the ContactName that you want to have appear in the ComboBox.  I will assume for the purposes of this explanation that this class has a property called "LastName".  Select that property so that the last name of the ContactPersons will appear in the ComboBox.  Click OK, etc. to exit the property sheet.<br /><br />Now what you want to do is populate the BindingSource you just created above with the ContactPersons that would be valid for the selected Order. One way to do this is to implement an EventHandler for the CurrentItemChanged event for the BindingSource that is populating the Order ControlBindingManager.  Within this EventHandler, add code that looks something like:<br /><br />Order aOrder = (Order)OrderBindingSource.Current<br /><br />I apologize for the C# code.  Basically you will have to cast the OrderBindingSource.Current object to an Order object and I'm a little shaky on the use of the CType cmmand in VB.  <br /><br />You would then have a line of code that reads something like ContactPersonsBindingSource.DataSource = aOrder.ContactPersons<br /><br />where you reference the property you defined in your Order class.<br /><br />Now what should happen is that for any particular Order that is displayed the list of possible ContactPersons that is appropriate for the Customer who placed the Order should appear.  The current setting in the ComboBox would be the actual ContactPerson that is currently set for that Order.  If you change the selection in the ComboBox, then, with DevForce's bidirectional data binding, when you Save the change, the new ContactPersonId should be set in the database for that Order.<br /><br />Obviously I have made some assumptions about variable names, etc.  I hope my explanation is clear nonetheless.<br />]]>
   </description>
   <pubDate>Wed, 29 Aug 2007 13:00:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=383&amp;PID=1028#1028</guid>
  </item> 
  <item>
   <title>Combobox binding : Hi  I am a newbie to DevForce,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=383&amp;PID=977#977</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=130" rel="nofollow">jcdk</a><br /><strong>Subject:</strong> 383<br /><strong>Posted:</strong> 25-Aug-2007 at 10:23am<br /><br />Hi<DIV>&nbsp;</DIV><DIV>I am a newbie to DevForce, but I can already see that it will speed op development dramatically.</DIV><DIV>&nbsp;</DIV><DIV>I do have a problem with comboboxes though. I am showing orders on a master detail form. The order has one customer. The customer has many Contact Persons. I want to display a dropdown box of Contact Persons on the form.</DIV><DIV>&nbsp;</DIV><DIV>I have managed to get a list of valid Contact Persons for each order by extending the order class with ContactPersons using something like this</DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff>Public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>ReadOnly</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Property</FONT><FONT size=2> ContactPersons() </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> EntityList(</FONT><FONT color=#0000ff size=2>Of</FONT><FONT size=2> ContactPerson)</FONT></DIV><DIV><FONT color=#0000ff size=2>&nbsp; Get</FONT></DIV><DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp; Dim</FONT><FONT size=2> aContactPersons </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> EntityList(</FONT><FONT color=#0000ff size=2>Of</FONT><FONT size=2> ContactPerson)</DIV><DIV><DIV></FONT></FONT><FONT size=2><FONT size=2>&nbsp;&nbsp;&nbsp; aContactPersons = </FONT><FONT color=#0000ff size=2>Me</FONT><FONT size=2>.PersistenceManager.GetChildren(</FONT><FONT color=#0000ff size=2>Of</FONT><FONT size=2>&nbsp;</FONT></FONT></DIV><DIV><FONT size=2><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ContactPerson)(</FONT><FONT color=#0000ff size=2>Me</FONT><FONT size=2>.Customer, </FONT></FONT></DIV><DIV><FONT size=2><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;EntityRelations.Customer_ContactPerson, </FONT><FONT color=#0000ff size=2>True</FONT><FONT size=2>)</FONT></FONT></DIV><DIV><FONT size=2><FONT color=#0000ff size=2>Return</FONT><FONT size=2> aContactPersons</FONT></FONT></DIV><DIV><FONT size=2><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Get</FONT></FONT></DIV><DIV><FONT size=2><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Property</DIV></DIV><DIV></FONT></FONT><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>I would have expected that I could use this property directly in the ControlBindingManager, but I get the message "There are no controls suitable for ContactPersons". </FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>I've tried to create a new datasource, chaining it after the Orders datasource, and selecting ContactPersons. Using this as a binding source for my combobox it updates the valid values correctly on each order.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>I've then used the databinding of the combobox to connect it back to the original orders datasorce. It works when I first enter the form, but when I move back and forth the combobox stops moving.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>I am afraid that I am on a wrong track. If I am, please show me the way.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Any help greatly appriciated.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Regards</FONT></DIV><DIV><FONT size=2>Jesper Carstensen</DIV></FONT>]]>
   </description>
   <pubDate>Sat, 25 Aug 2007 10:23:43 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=383&amp;PID=977#977</guid>
  </item> 
 </channel>
</rss>