"Harald Bjorøy" <harald.bjoroy-at-ulriken-consulting.no> wrote in message news:<eu4xEYesEHA.376@TK2MSFTNGP09.phx.gbl>...
> Hi
>
[quoted text clipped - 80 lines]
> Regards,
> Harald Bjorøy
Hello Harald, we are using the same architecture as you and
encountered this same problem.
We resolve this not assigning the dataset because as you correctly say
it destroys the previous databinding.
You should do this instead:
dataSet1.Clear();
dataSet1.Merge(dataSet2);
being "dataSet2" the DataSet "set" to the usercontrols. If you do so
the "RAD" databinding you created will be maintained.
We have found the method "Merge" extremely useful and are using it in
more scenarios.
hope it helps, cheers
Harald Bjor?y - 22 Oct 2004 10:36 GMT
Thanx, this is the answer I was looking for - this will work.
The interface I am working towards is intact, and the RAD in the control is
not breaking.
I have been looking for this answer for a long time, I also noticed that the
same problem exists in VS2005.
Harald
>> If i "rebind" by "manually" do the binding, everything works - but this
>> breaks the "RAD"-thing - I have to create my own binding-method that
[quoted text clipped - 31 lines]
>
> hope it helps, cheers
Harald Bjor?y - 22 Oct 2004 11:58 GMT
Well, I was a little bit quick in answering that this was The Answer...
It certainly helps in many situations - especially when I do the binding to
a modal dialog box, when I am able to determine that editing is finished
(dialog closed). But without merging back the data, change on one tab is not
reflected instantly on the other tab.
A problem is that the whole data set is duplicated in all controls - this
may add up to be vast.
I'll try to remedy these problems by saving the reference to the original
data set, and merge back when the control loses focus.
"I still haven't found what I'm looking for"... - but this is the best
workaround this far.
Microsoft: What about splitting InitializeComponent() to
InitializeComponent() and InitializeDatabinding()? This way we are able to
re-bind when the parent changes the data source of the user control?
It seems the upcoming Connector of .Net 2.0 still carries this problem - it
doesn't help binding to the Connector - the real data binding seems to be to
the underlying data table, as do the DataView of today.
Regards
Harald Bjor?y,
Ulriken Consulting AS
Norway
> Hello Harald, we are using the same architecture as you and
> encountered this same problem.
[quoted text clipped - 14 lines]
>
> hope it helps, cheers
Tony Santolaria - 22 Oct 2004 18:53 GMT
Yes, you are right. The reason we are using this is because in our
scenario we don´t have the same DataTables used in different
"controls" so we are not facing this trouble.
However we noticed this when we got a little replication in a pair of
controls, it was fixed with a similar approach you proposed (using
delegates but it is not worth explaining it because is not a good
solution neither).
As you say this can get huge in case of using the same data in
different controls, in fact I am wondering if not will be better to
implement manually the solution you are proposing. I'm still learning
a lot about .NET so I hope I will find a better solution in the
future,
"Harald Bjorøy" <harald.bjoroy-at-ulriken-consulting.no> wrote in message news:<upI$KYCuEHA.224@TK2MSFTNGP15.phx.gbl>...
> Well, I was a little bit quick in answering that this was The Answer...
>
[quoted text clipped - 25 lines]
> Ulriken Consulting AS
> Norway