CSLA 3.7 bindingsourcerefresh not working

CSLA 3.7 bindingsourcerefresh not working

Old forum URL: forums.lhotka.net/forums/t/7701.aspx


pandelaras posted on Tuesday, September 29, 2009

I am currently upgrading my project from CSLA 3.0.3 to 3.7.0. One of the thing i made sure was to remove bindingsourcerefresh controls from my forms and add them again. It seems that all controls are working the same as before but smartdate doesnt work as supposed. When i enter the value "." i  get the current date only after i update another control. It seems that the problem only appears with smartdate! Other controls seem to be fine

I am using devexpress controls, should this have anything to do with it? I had no problem before.
The bindingsource controls are the same. What could be wrong?

RockfordLhotka replied on Tuesday, September 29, 2009

Can you try with standard controls (even a small test) to help identify if the problem is bindingsourcerefresh or unique to the devexpress controls?

The bindingsourcerefresh control changed in 3.5 to address some bugs with null value handling and some other issues. That was a couple years ago, and to my knowledge it has been working fine since that time. I don't believe the control has been changed since then.

pandelaras replied on Wednesday, September 30, 2009

This is the most weird thing. I created another project using the same csla object. The other project was a simple windows forms project with a few controls binded to an editableroot object (through a bindingsource). Readvaluesonchange is set to true and the desired code appears below the bindingsource inside the designer.

Me.MY_ERBindingSource.DataSource = GetType(testbindingsourcerefresh1.MY_ER)
Me.BindingSourceRefresh1.SetReadValuesOnChange(Me.MY_ERBindingSource, True)

I still dont get the desired result! Is it possible that i am adding the bindingsourcerefresh the wrong way? Being lazy i copy paste it from another project of mine .... Could this be it?

Vinodonly replied on Wednesday, September 30, 2009

i was having same issue.. del and add again, it will work.. chk this post

http://forums.lhotka.net/forums/thread/34367.aspx

pandelaras replied on Wednesday, September 30, 2009

I did delete it and add it again. I even created a new form with new controls. Perhaps i am adding it wrong? Cause deleting i am sure i am doing it ok :)

RockfordLhotka replied on Wednesday, September 30, 2009

I've logged this issue as a bug

http://www.lhotka.net/cslabugs/edit_bug.aspx?id=585

But I don't know when I'll get to this - almost certainly not for 2-3 weeks at best (and that's optimistic).

I know it is hard to debug Windows Forms components - but if you need this resolved sooner than later, you may want to dig in and give it a try.

pandelaras replied on Wednesday, September 30, 2009

 Thank you for your time Rocky. My main concern was that i found no obvious solution. As long as one can be found, i will be fine :)

pandelaras replied on Wednesday, September 30, 2009

i am attaching a test project that the bindingsourcerefresh appears not to be working

http://www.easy-share.com/1907958802/testbindingsourcerefresh1.zip

JonnyBee replied on Thursday, October 01, 2009

Hi,

The reason BindingSourcerefesh is failing is because you are missing a setting in the designer file. This should have been set automatically as:

Me.bindingSourceRefresh1.Host = Me

If Host is not set properly the bindingSourceRefresh will not hook into events on the BindingSources and so not do anything useful.

You may also set Me.bindingSourceRefresh1.Host = Me after InitializeComponents in your forms constructor.


pandelaras replied on Saturday, October 03, 2009

Indeed that fixed it! Thank you!

Copyright (c) Marimer LLC