Print Page | Close Window

"DataSourceUpdateMode = OnPropertyChanged" does not work for related properties

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=579
Printed Date: 28-Apr-2025 at 5:11am


Topic: "DataSourceUpdateMode = OnPropertyChanged" does not work for related properties
Posted By: Miszou
Subject: "DataSourceUpdateMode = OnPropertyChanged" does not work for related properties
Date Posted: 04-Dec-2007 at 12:38pm

I am trying to set the "DataSourceUpdateMode = OnPropertyChanged" for a column that is managed by Control Binding Manager, but I can't seem to get it to work at all.

It works for simple columns that are a part of the main entity, but not for any columns in other entities that are joined in the "Configure DataBindings" dialog.
 
ie. I can properly set the DataSourceUpdateMode for fields in the parent entity, but it doesn't seem to work for fields in related entities. for example, the following code works:
 
this.CBM.Descriptors.Get("Property").DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
 
but this code does not:
 
this.CBM.Descriptors.Get("Table.Property").DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
 
It also does not matter if I use the overloaded "Get" method and pass references to the actual controls - if the control is bound to a property through a relation, it will not work.
 
I have tried adding "TextChanged" handlers to the necessary controls and calling Validate on the object, as well as calling ForcePropertyChanged, but neither of these solutions worked correctly.
 
Is there some trick to getting these controls to raise a "CurrentItemChanged" event?
 



Replies:
Posted By: davidklitzke
Date Posted: 05-Dec-2007 at 11:43am
Here is how to do it with an Infragistics UltraCombobox:
 
http://www.ideablade.com/forum/uploads/20071205_143906_ComboBox.zip - uploads/20071205_143906_ComboBox.zip
 
 
 
 
 
 
 


Posted By: Miszou
Date Posted: 07-Feb-2008 at 3:55pm
I don't suppose you have a working example for .NET controls?
 
I can't test the version you attached as I am not using Infragistics controls. However, it looks to be almost identical to what I am doing, which does not work.
 
As I said in my initial post, this works:
 
this.CBM.Descriptors.Get("PropertyA").DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
 
but this code does not:
 
this.CBM.Descriptors.Get("Table.PropertyB").DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
 
I am simply trying to get notification via the "CurrentItemChanged" event of the Binding Source whenever the user changes the contents of a text box.
 
Thank you.



Print Page | Close Window