Accessing data and model information from a UI Control

If you set the dataSet property on a control, you should avoid accessing the DataSet data or model information programatically through the control until the control's peer has been created; basically, this means until the control is displayed in the application UI.

Operations which fail or return incorrect/inconsistent results when executed before the control is displayed in the application UI include any operation that accesses the model of the control's architecture. This may include,

For more information on model-view architecture, see Understanding model-view component architecture in the Component Writer's Guide.

To assure successful execution of such operations, check for the open event notification generated by the DataSet. Once the event notification occurs, you are assured that the control and its model architecture are properly initialized.