Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
The reason is that during the InitializeComponent, the ChildAutoFilterOption is being set. When that property is set, it cascades the filter to the child business objects, and if the filter changes on the child business objects, then the child business objects call Navigate() so that the bound controls are refreshed to the correct record. So, none of your business objects have any data, yet, but when the ChildAutoFilterOption is being set, it causes one of your business objects to Navigate() and you have an event handler on the Navigated event, which is filling the business object. So, it's being filled prematurely. It's just like adding a handler to a TextBox.TextChanged event and setting the text at design-time. The TextChanged event gets raised when the text is initially set during the InitializeComponent method, and if you have some code in your handler, it might fail because most of the other objects are not yet instantiated, so, you add a flag to let you know when the form has finished loading.
|