473,396 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

RelatedCurrencyManager Binding Errors when Bound to Filtered DataView that contains no Results (MS Bug??)

I've been experiencing some frustrating behavior that I believe may be a MS bug in the Framework. Has anyone else experienced this, know a better way to resolve it, or if it is an actual MS bug

*) I have a DataSet containing 2 tables, A and B
*) There is a 1-to-1 relation between the tables with table A being the parent. (ABrel
*) A DataView is created on table A to allow filtering of the result se
*) 2 Text Boxes are created and Bound to a column in table A and B through the Datavie
-> box1.DataBindings.Add(new Binding("Text", DataView, "col1"
-> box2.DataBindings.Add(new Binding("Text", DataView, "ABrel.col1"

As the DataView's Row filter changes, all appears to work fine. The values displayed in the boxes change as they should, until the filter produces no results. When no results are found, the following occurs
*) box1 goes blank and binding is suspende
*) box2 contains the prior bound value, and is not suspended. This value can be edited and the changes will be made to the prior binding!

Using the Debugger I'm able to confirm the following about the binding contexts

*) BindingContext(DataView) is of type CurrencyManager and is Suspended when no results exist in DataVie
*) BindingContext(DataView, "ABrel") is of type RelatedCurrencyManager and is not Suspended when no results exist in DataView

I assume that this behavior is a bug and not designed for. When a parent is suspended, all children should be suspended as well

The fix I found, is that each time the filter is applied to the DataView I have to perform the following statement

DataView.RowFilter = <new value
if( DataView.Count = 0 ) The
Me.BindingContext(DataView, "ABrel").SuspendBinding(
els
Me.BindingContext(DataView, "ABrel").ResumeBinding(
End I

This seems unnecessary since the Framework automatically handles suspending the parent CurrencyManager: BindingContext(DataView)

Has anyone else encountered this? Do you know why if MS designed it to behave this way

Thanks in advance for any information
Jul 21 '05 #1
0 1536

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ben | last post by:
Dim dv As DataView = New DataView (DataSet11.Tables("InventoryTable")) dv.RowFilter = "ItemAuthor LIKE '" & ItemAuthor.Text & "%'" dv.RowStateFilter = DataViewRowState.ModifiedCurrent dv.Sort...
3
by: Shravan | last post by:
Hi, How can I bind DataRow array to ComboBox. I tried setting DataSource -> DataRow Array DisplayMember -> ColumnName But it was showing "System.Data.DataRow" for every item in the...
13
by: Paul Slavin | last post by:
I have a textbox bound to a dataview, when I update the text in the textbox no changes take place in the underlying dataset. Why is this?? any answers appreciated, as to due to the underlying...
6
by: MrNobody | last post by:
I have a DataGrid sourced by a DataView of a DataTable, and I would like to output the results of any RowFilter operations to a text file. I thought this would be easy but I cannot find where to...
17
by: David | last post by:
Hi all, I have the following problem: my program works fine, but when I add option strict at the top of the form, the following sub fails with an error that option strict does not allow late...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
0
by: RPI_alum | last post by:
I've been experiencing some frustrating behavior that I believe may be a MS bug in the Framework. Has anyone else experienced this, know a better way to resolve it, or if it is an actual MS bug ...
4
by: s | last post by:
I'm able to get the count of the filtered rows of the dataview from within the With view block, but when I try to bind the view to the listbox I don't get any count within the With lb1 block and my...
2
by: Rich | last post by:
Hello, Following an example at http://www.vb-tips.com/dbpages.aspx?IA=DG (by Cor Lightert and Ken Tucker) on binding a dataRelation to a Datagridview for sqlClient, I was able to view rows...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.