New Posts New Posts RSS Feed: "DataSourceUpdateMode = OnPropertyChanged" does not work for related properties
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

"DataSourceUpdateMode = OnPropertyChanged" does not work for related properties

 Post Reply Post Reply
Author
Miszou View Drop Down
Newbie
Newbie
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 19
Post Options Post Options   Quote Miszou Quote  Post ReplyReply Direct Link To This Post Topic: "DataSourceUpdateMode = OnPropertyChanged" does not work for related properties
    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?
 
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 05-Dec-2007 at 11:43am
Here is how to do it with an Infragistics UltraCombobox:
 
 
 
 
 
 
 
 
Back to Top
Miszou View Drop Down
Newbie
Newbie
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 19
Post Options Post Options   Quote Miszou Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down