Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > BindingSource List property doesn't return records from bound relationship or filter
 

BindingSource List property doesn't return records from bound relationship or filter

I have a BindingSource for a child table bound to the Foreign Key relationship of the Binding Source for its parent table e.g.:

ChildBindingSource.DataSource = ParentBindingSource
ChildBindingSource.DataMember = FK_Child_Parent

This works fine if I bind a DataGridView to ChildBindingSource. Only child records for the selected parent are displayed. However, I can't get it to work via the ChildBindingSource List property. I need to populate a list in a toolstrip combobox with the Children of the selected Parent.

The List property of the binding source returns the entire Child table from the dataset, not the joined table from the FK relationship, so includes all child records, not just the selected ones. The returned List also ignores any filter property that is set.

How can I access just the selected Child records programatically from the BindingSource? The alternative is to go direct to the dataset, I guess, but this defeats the purpose of the binding source.

Thanks,

Rob

Rob Weiss  Monday, December 19, 2005 10:34 PM
Hi Rob
FK relationship had problem. You can test FD relationship

Can you post your code??

C#...Oh yeah
QUANGHUY_VN  Thursday, August 06, 2009 7:08 AM

You can use google to search for other answers

Custom Search

More Threads

• in a string i need to find and replace a word of vb.net programming
• DataBinding vs Event Handler
• binding source control
• Binding data source to Checkedlistbox in C#.NET
• Formatting negative numbers as red in datagrid (event question)
• DataGrid rows not editable
• Datagrid Sort Problem
• we got an error "operator is not valid for DBNull and type Integer"
• Skip tabbing into readonly Columns in datagridview c#
• Setting FirstDisplayedCell gives "Not enough room to display columns"