protected override void OnDataBinding(EventArgs e)
{
base.OnDataBinding(e);
//Only bind if the control has the DataSource or DataSourceID set
if(this.DataSource != null || IsBoundUsingDataSourceID) {
// reset the control state
ClearPanes();
ClearChildViewState();
// and then create the control hierarchy using the datasource
CreateControlHierarchy(true);
ChildControlsCreated = true;
}
}