<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Related Data Binding and ComboBoxes with LINQ to SQL</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/02/06/related-data-binding-and-comboboxes-with-linq-to-sql.aspx</link><description>In a previous post I showed how to set up related data binding using ComboBoxes against DataSets and a loyal reader asked how this would be done using LINQ and Visual Studio 2008. I assume he meant LINQ to SQL in this case, because remember LINQ can be</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Related Data Binding and ComboBoxes with LINQ to SQL</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/02/06/related-data-binding-and-comboboxes-with-linq-to-sql.aspx#10017411</link><pubDate>Sun, 30 May 2010 03:36:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10017411</guid><dc:creator>Mick C</dc:creator><description>&lt;p&gt;Hi Beth,&lt;/p&gt;
&lt;p&gt;I have a dataset containing 6 tables (Country, Region, Province, City, Suburb, Street) which have a relationship established on unique key down to the street level so the locality is related. When i use this dataset in a form (to store users location details in a separate dataset) and apply 6 combo boxes in a form to allow the user to select location, the details display ok but show all records from each datatable. In the combobox selected value change event for each combobox i have retrieved the selected keyid and then applied this in a fill query to obtain correct subset child data for the parent id selected. when i move to another record in the main binding source, the lookups in the 6 comboboxes do not display the data user has selected. I have been searching for an answer in particular through your video series but have been unable to find a solution to this problem. Hope you may be able to enlighten me&lt;/p&gt;
&lt;p&gt;regards,&lt;/p&gt;
&lt;p&gt;Mick C&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10017411" width="1" height="1"&gt;</description></item><item><title>re: Related Data Binding and ComboBoxes with LINQ to SQL</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/02/06/related-data-binding-and-comboboxes-with-linq-to-sql.aspx#9837590</link><pubDate>Fri, 17 Jul 2009 19:16:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9837590</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Jack, &lt;/p&gt;
&lt;p&gt;I use live writer for everything. I just paste screen shots into the posts and it handles uploading them as pictures. &lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9837590" width="1" height="1"&gt;</description></item><item><title>re: Related Data Binding and ComboBoxes with LINQ to SQL</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/02/06/related-data-binding-and-comboboxes-with-linq-to-sql.aspx#9836416</link><pubDate>Fri, 17 Jul 2009 05:26:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9836416</guid><dc:creator>Jack Webb</dc:creator><description>&lt;p&gt;Sorry for the delayed response, I'm in a different time zone! &amp;nbsp;I saw you post re using Live Writer to paste VS code which includes formatting (see below).&lt;/p&gt;
&lt;p&gt;I now wonder how you also paste dialog boxes as well.&lt;/p&gt;
&lt;p&gt;tia&lt;/p&gt;
&lt;p&gt;jjw&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9836416" width="1" height="1"&gt;</description></item><item><title>re: Related Data Binding and ComboBoxes with LINQ to SQL</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/02/06/related-data-binding-and-comboboxes-with-linq-to-sql.aspx#9823095</link><pubDate>Tue, 07 Jul 2009 22:52:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9823095</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Jerry,&lt;/p&gt;
&lt;p&gt;You can just write a LINQ query to order the collection you want to bind to. For instance in the above example if I wanted to sort the Regions on RegionDescription field then I could do this:&lt;/p&gt;
&lt;p&gt;Me.RegionComboBox.DataSource = Nothing&lt;/p&gt;
&lt;p&gt;Dim sortedRegionList = (From r In db.Regions _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Order By r.RegionDescription).ToList()&lt;/p&gt;
&lt;p&gt;Me.RegionBindingSource.DataSource = sortedRegionList&lt;/p&gt;
&lt;p&gt;Me.RegionComboBox.DataSource = Me.RegionBindingSource&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9823095" width="1" height="1"&gt;</description></item><item><title>re: Related Data Binding and ComboBoxes with LINQ to SQL</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/02/06/related-data-binding-and-comboboxes-with-linq-to-sql.aspx#9823038</link><pubDate>Tue, 07 Jul 2009 21:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9823038</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Kevin,&lt;/p&gt;
&lt;p&gt;When you drag-drop the tables from the data source window onto the Winform it will create the BindingSources for you on the form in the component tray. Take a look at these videos: &lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/vbasic/bb725824.aspx"&gt;http://msdn.microsoft.com/en-us/vbasic/bb725824.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/vbasic/cc138241.aspx"&gt;http://msdn.microsoft.com/en-us/vbasic/cc138241.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9823038" width="1" height="1"&gt;</description></item><item><title>re: Related Data Binding and ComboBoxes with LINQ to SQL</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/02/06/related-data-binding-and-comboboxes-with-linq-to-sql.aspx#9820686</link><pubDate>Tue, 07 Jul 2009 00:20:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9820686</guid><dc:creator>Jerry</dc:creator><description>&lt;p&gt;I have learned a lot from your blogs and videos. &amp;nbsp;Sorry to dig up an old post, but just getting into LINQ to SL on Winforms. &amp;nbsp;Been using it on webforms, mostly MVC.&lt;/p&gt;
&lt;p&gt;The question I have is this, how can I sort the data prior to binding it to the combobox? &amp;nbsp;I want to sort on customername (text) and customerid will be the value. &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9820686" width="1" height="1"&gt;</description></item><item><title>re: Related Data Binding and ComboBoxes with LINQ to SQL</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/02/06/related-data-binding-and-comboboxes-with-linq-to-sql.aspx#9770008</link><pubDate>Wed, 17 Jun 2009 21:13:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9770008</guid><dc:creator>Kevin Burton</dc:creator><description>&lt;p&gt;I brought up the Data Sources window and I added some data sources and I don't get the equivalent of RegionBindingSource (or any code for that matter).&lt;/p&gt;
&lt;p&gt;What am I doing wrong?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9770008" width="1" height="1"&gt;</description></item><item><title>Data Binding WPF Lookup Combobox Values to EF Entities</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/02/06/related-data-binding-and-comboboxes-with-linq-to-sql.aspx#9582646</link><pubDate>Fri, 01 May 2009 20:18:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9582646</guid><dc:creator>Beth Massi - Sharing the goodness that is VB</dc:creator><description>&lt;p&gt;It’s extremely common to have to hook up lookup tables on your data entry forms in order to populate&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9582646" width="1" height="1"&gt;</description></item><item><title>re: Related Data Binding and ComboBoxes with LINQ to SQL</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/02/06/related-data-binding-and-comboboxes-with-linq-to-sql.aspx#9493208</link><pubDate>Fri, 20 Mar 2009 22:00:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9493208</guid><dc:creator>Waner Michaud</dc:creator><description>&lt;p&gt;Hi Beth,&lt;/p&gt;
&lt;p&gt;I have a form that has a IGPNHDataSet with three Related tables(Registration_Table, Complaint_Table, Offender_Table)&lt;/p&gt;
&lt;p&gt;Relationship as follows: FK_complaint_ID, FK_offender_ID are both in the Registration_Table..&lt;/p&gt;
&lt;p&gt;Registration Table:&lt;/p&gt;
&lt;p&gt;Reg_ID as PK&lt;/p&gt;
&lt;p&gt;Date&lt;/p&gt;
&lt;p&gt;Complaint_ID&lt;/p&gt;
&lt;p&gt;Offender_ID&lt;/p&gt;
&lt;p&gt;Desc&lt;/p&gt;
&lt;p&gt;Nature&lt;/p&gt;
&lt;p&gt;Complaint Table:&lt;/p&gt;
&lt;p&gt;complaint_Id as PK&lt;/p&gt;
&lt;p&gt;lastname&lt;/p&gt;
&lt;p&gt;firstname&lt;/p&gt;
&lt;p&gt;phone&lt;/p&gt;
&lt;p&gt;Offender Table:&lt;/p&gt;
&lt;p&gt;Offender_ID&lt;/p&gt;
&lt;p&gt;lastname&lt;/p&gt;
&lt;p&gt;firstname&lt;/p&gt;
&lt;p&gt;phone&lt;/p&gt;
&lt;p&gt;etc..&lt;/p&gt;
&lt;p&gt;Above is my tables structure.&lt;/p&gt;
&lt;p&gt;On the form, I drag all the info for all three tables..&lt;/p&gt;
&lt;p&gt;Onload, I get all the records from the tables..&lt;/p&gt;
&lt;p&gt;when i click on NEW to do a new registration which will include new complainant and offender, the fields from the regitration table is cleared and i can enter new record&lt;/p&gt;
&lt;p&gt;but for complainant and offender, no action is taking, i cannot enter new info for them.&lt;/p&gt;
&lt;p&gt;Can you please guide me on what to do and need to save/update the records&lt;/p&gt;
&lt;p&gt;if need be, send me some guidances at wnmichaud@yahoo.com&lt;/p&gt;
&lt;p&gt;thanks..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9493208" width="1" height="1"&gt;</description></item><item><title>re: Related Data Binding and ComboBoxes with LINQ to SQL</title><link>http://blogs.msdn.com/b/bethmassi/archive/2008/02/06/related-data-binding-and-comboboxes-with-linq-to-sql.aspx#9402357</link><pubDate>Fri, 06 Feb 2009 18:34:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9402357</guid><dc:creator>enrique.prados@a-e.es</dc:creator><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;How can I change color of a cell in datagridview in this issue:&lt;/p&gt;
&lt;p&gt;- Linking BindingSource with DAtagridView&lt;/p&gt;
&lt;p&gt;- When I add item in BindingSource I want change color of a new row inserted in DatagridView&lt;/p&gt;
&lt;p&gt;Thanks in advance, kind regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9402357" width="1" height="1"&gt;</description></item></channel></rss>