SL v3.6.1 DataProvider_DataChanged

SL v3.6.1 DataProvider_DataChanged

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


davido_xml posted on Thursday, April 02, 2009

Hi,

I use the DataProvider_DataChanged event so I can be sure an async operation has completed before I update another part of the applicaiton. Unfortunately the event seems to get raised twice for each operation. This makes me code module level booleans to record "has this already happened" quite a bit which is not great :(

A few questions:

1) Are there alternative events that only get called once e.g. Loaded, Saved etc.

2) Is there a way to examine the parameters in DataProvider_DataChanged to distinguish between the first and second call?

3) Does everyone else experience this double calling? How do you deal with it?

 

RockfordLhotka replied on Thursday, April 02, 2009

This sounds like a bug to me. Can you see if you still have the issue with 3.6.2 - if so I'll add it as a bug.

ajj3085 replied on Thursday, April 02, 2009

This is how the Wpf CslaDataProvider acts as well. 

I dug into the CslaDataProvider to figure out why Infragistics grids don't display column headers / sample data.  The provider doesn't behave quite like the ObjectDataProvider does in certain aspects.

davido_xml replied on Thursday, April 02, 2009

I still get duplicate calls in v3.6.2

I will try a few things with v3.6.2 and update if I come up with anything

davido replied on Monday, April 06, 2009

As far as I can see the two calls are being driven by the highlighted lines below. Changing .Error or .ObjectInstance has the ability to call OnDataChanged.

private void QueryCompleted(object sender, EventArgs e)

{

IDataPortalResult eventArgs = e as IDataPortalResult;

this.Error = eventArgs.Error;

this.ObjectInstance = eventArgs.Object;

RefreshCanOperationsValues();

this.IsBusy = false;

}

RockfordLhotka replied on Monday, April 06, 2009

See what a second pair of eyes can do. That is a very good observation and is a problem. Glancing at the code though, implementing a  solution is going to take a bit of refactoring…

 

Thank you!

 

Rocky

Copyright (c) Marimer LLC