BaseDataBoundControl.EnsureDataBound Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Calls the DataBind() method if the DataSourceID property is set and the data-bound control is marked to require binding.
protected:
virtual void EnsureDataBound();
protected virtual void EnsureDataBound ();
abstract member EnsureDataBound : unit -> unit
override this.EnsureDataBound : unit -> unit
Protected Overridable Sub EnsureDataBound ()
Remarks
The EnsureDataBound method is called during the OnPreRender method, to call the DataBind method if the data-bound control is not yet bound.
This is the same behavior pattern that the BaseDataList (from which classes such as DataGrid are derived) and Repeater classes follow. The EnsureDataBound
method might also be called during calls to CreateChildControls
and LoadPostData
methods.