protected override void DataBind(BaseDataBoundControl dataBoundControl) { IEnumerable designTimeDataSource = this.GetDesignTimeDataSource(); string dataSourceID = dataBoundControl.DataSourceID; object dataSource = dataBoundControl.DataSource; dataBoundControl.DataSource = designTimeDataSource; dataBoundControl.DataSourceID = string.Empty; try { if (designTimeDataSource != null) { dataBoundControl.DataBind(); } } finally { dataBoundControl.DataSource = dataSource; dataBoundControl.DataSourceID = dataSourceID; } }
public static void Bind2Gridview(BaseDataBoundControl gdv, DataTable dt) { gdv.DataSource = dt; gdv.DataBind(); }
// This function binds the given ListView with the given data table. public static void Bind2DetailsView(BaseDataBoundControl dv, DataTable dt) { dv.DataSource = dt; dv.DataBind(); }
protected override void DataBind(BaseDataBoundControl dataBoundControl) { try { dataBoundControl.DataBind(); } catch { base.DataBind(dataBoundControl); } }