New Posts New Posts RSS Feed: Control setters are being called too many times.
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Control setters are being called too many times.

 Post Reply Post Reply
Author
fastianumair View Drop Down
Newbie
Newbie


Joined: 27-Feb-2008
Posts: 1
Post Options Post Options   Quote fastianumair Quote  Post ReplyReply Direct Link To This Post Topic: Control setters are being called too many times.
    Posted: 27-Feb-2008 at 7:00am
Hi.
 
When I change some text in a textbox, the setter of datamember fields of other controls on the same form are being called so many times. Sometimes 2, 3 or 4 times. I tried to trace and concluded that if the property changes, so the datasource changes. It binds the controls of the form again. But if it is so, then it should bind all the controls only once, at most. Why does it call the setter of datamember field of all the controls on the form; so many times?
 
How can this be prevented?
 
 
Additional Information:
 
Using control library, Infragistic.
 
Thanks.
 
Regards,
 
Umair.
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: 27-Feb-2008 at 9:16am
As I understand, this is a characteristic of UI binding, and is not specific to DevForce.  If you can show us that DevForce behaves worse than native .NET binding, we will be happy to look at it.
Back to Top
banzaii View Drop Down
Newbie
Newbie
Avatar

Joined: 14-Dec-2007
Location: Pakistan
Posts: 9
Post Options Post Options   Quote banzaii Quote  Post ReplyReply Direct Link To This Post Posted: 28-Feb-2008 at 9:54am

Hi, David!

Can you ensure me the behavior...

Behaviour

MyModelEntity has 5 Properties..

5 Different Controls are bind to that Entity. The controls use ControlDataBinder, UltraComboEditorDataBinder.

As soon as my Property 'A' changes, the Setter of the Value property of respectedly bind control get a call, fine.
But!!! all other control's "Setter" of "Value" property get a call too even though their Property isn't changed.
 
I check/uncheck a bool property, it fires the Value Setters of Combo, Textbox, Checkbox, and etc.

controlBindingDescriptor.DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;

Is it because of this PropertyChanged? Still, can there be a check of Property? (Fire the setter of the control that is bind to the currently changed property only. And not the controls, of either the same type or different, with different properties).

Ideablade 3.6.0.2
 
Thanks and Regards.
HumaiR Bhagat.
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: 03-Mar-2008 at 11:22am
I don't know if this behavior can be changed.  In some cases, setting a property on one field may change the propery of another field.  For example, changing "BirthDate" will also change "Age".
Back to Top
banzaii View Drop Down
Newbie
Newbie
Avatar

Joined: 14-Dec-2007
Location: Pakistan
Posts: 9
Post Options Post Options   Quote banzaii Quote  Post ReplyReply Direct Link To This Post Posted: 05-Mar-2008 at 10:27pm
Originally posted by davidklitzke

I don't know if this behavior can be changed.  In some cases, setting a property on one field may change the propery of another field.  For example, changing "BirthDate" will also change "Age".
 
No! the properties are not related to each other...
Infact, It goes to the value setter of each control that is bind on that view.
 
for e.g. my Amount doesnot have any relation with what is the Father Name of the entity, still It will go to the value setter of the FatherName control.
 
One thing I would like to clear, It doesNOT go the Business Model for re-setting properties, It ONLY goes to the Control's Value setter, may be this is some behaviour used for refreshing controls.
 
But if this can be done on related properties/controls only?
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: 07-Mar-2008 at 9:33am

I think the important thing to understand here is that this behavior is just the way that binding works in WinForms.  It is not something that DevForce can change,

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down