protected override void DataBind(BaseDataBoundControl dataBoundControl) { System.Web.UI.WebControls.Menu menu = (System.Web.UI.WebControls.Menu) dataBoundControl; if (((menu.DataSourceID != null) && (menu.DataSourceID.Length > 0)) || ((menu.DataSource != null) || (menu.Items.Count == 0))) { menu.Items.Clear(); base.DataBind(menu); } }
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; } }
protected override void DataBind(BaseDataBoundControl dataBoundControl) { IHierarchicalEnumerable designTimeDataSource = this.GetDesignTimeDataSource(); string dataSourceID = dataBoundControl.DataSourceID; object dataSource = dataBoundControl.DataSource; HierarchicalDataBoundControl control = (HierarchicalDataBoundControl) dataBoundControl; control.DataSource = designTimeDataSource; control.DataSourceID = string.Empty; try { if (designTimeDataSource != null) { control.DataBind(); } } finally { control.DataSource = dataSource; control.DataSourceID = dataSourceID; } }
protected override void DataBind (BaseDataBoundControl dataBoundControl) { throw new NotImplementedException (); }
protected abstract void DataBind (BaseDataBoundControl dataBoundControl);
public static void Bind2Gridview(BaseDataBoundControl gdv, DataTable dt) { gdv.DataSource = dt; gdv.DataBind(); }
internal static void EnablePersistedSelection(BaseDataBoundControl baseDataBoundControl, IMetaTable table) { Debug.Assert(baseDataBoundControl != null, "NULL!"); // Make the persisted selection sync up with the selected index if possible if (!table.IsReadOnly) { DynamicDataExtensions.EnablePersistedSelectionInternal(baseDataBoundControl); } }
protected override void DataBind(BaseDataBoundControl dataBoundControl) { GridView view = (GridView) dataBoundControl; view.RowDataBound += new GridViewRowEventHandler(this.OnRowDataBound); try { base.DataBind(dataBoundControl); } finally { view.RowDataBound -= new GridViewRowEventHandler(this.OnRowDataBound); } }
protected override void DataBind(BaseDataBoundControl dataBoundControl) { base.DataBind(dataBoundControl); DetailsView view = (DetailsView) dataBoundControl; Table table = view.Controls[0] as Table; int autoGeneratedRows = 0; int num2 = 1; int num3 = 1; int num4 = 0; if (view.AllowPaging) { if (view.PagerSettings.Position == PagerPosition.TopAndBottom) { num4 = 2; } else { num4 = 1; } } if (view.AutoGenerateRows) { int num5 = 0; if ((view.AutoGenerateInsertButton || view.AutoGenerateDeleteButton) || view.AutoGenerateEditButton) { num5 = 1; } autoGeneratedRows = ((((table.Rows.Count - view.Fields.Count) - num5) - num2) - num3) - num4; } this.SetRegionAttributes(autoGeneratedRows); }
protected override void DataBind(BaseDataBoundControl dataBoundControl) { }
// 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) { System.Web.UI.WebControls.TreeView view = (System.Web.UI.WebControls.TreeView) dataBoundControl; this._usingSampleData = false; this._emptyDataBinding = false; if (((view.DataSourceID != null) && (view.DataSourceID.Length > 0)) || ((view.DataSource != null) || (view.Nodes.Count == 0))) { view.Nodes.Clear(); base.DataBind(view); } if (this._usingSampleData) { view.ExpandAll(); } else { this.ExpandToDepth(view.Nodes, view.ExpandDepth); if (view.Nodes.Count == 0) { this._emptyDataBinding = true; } } }
protected override void DataBind(BaseDataBoundControl dataBoundControl) { try { dataBoundControl.DataBind(); } catch { base.DataBind(dataBoundControl); } }
/// <summary> /// 绑定数据控件 /// </summary> /// <remarks> /// 绑定数据控件 /// </remarks> private void BindDataControl() { BaseDataBoundControl boundControl = (BaseDataBoundControl)this.Page.FindControlByID(this.DataBoundControlID, true); if (boundControl != null) { System.Type type = boundControl.GetType(); IPagerBoundControlType pagerControlType = new PagerBoundControlType(); PagerBoundControlStatus pbControlStatus = pagerControlType.GetPagerBoundControl(type); if (pbControlStatus.DataListControlType != DataListControlType.DataGrid) { boundControl.DataBound += new EventHandler(BoundControl_DataBound); this._BoundControl = boundControl; } } }