TextDataBindingHandler.DataBindControl(IDesignerHost, Control) 方法
定义
数据绑定到指定的控件。Data-binds the specified control.
public:
override void DataBindControl(System::ComponentModel::Design::IDesignerHost ^ designerHost, System::Web::UI::Control ^ control);
public override void DataBindControl (System.ComponentModel.Design.IDesignerHost designerHost, System.Web.UI.Control control);
override this.DataBindControl : System.ComponentModel.Design.IDesignerHost * System.Web.UI.Control -> unit
Public Overrides Sub DataBindControl (designerHost As IDesignerHost, control As Control)
参数
- designerHost
- IDesignerHost
为包含该控件的文档实现 IDesignerHost 的对象。An object implementing IDesignerHost for the document that contains the control.
注解
将 DataBindControl TextDataBindingHandler Text 控件的属性(如果存在)设置为示例数据字符串的方法。The DataBindControl method of TextDataBindingHandler sets the Text property of the control, if it exists, to a sample data string.
应在派生类中实现此方法,以便为自定义数据绑定处理程序提供功能。This method should be implemented in a derived class to provide functionality to a custom data-binding handler. 数据绑定的逻辑应在此方法内实现,并且可以特定于处理程序绑定属性或属性的类型。The logic for the data-binding should be implemented within this method, and can be specific to the type or types that the handler is binding a property or properties on.
继承者说明
大多数数据绑定处理程序需要使用接口检查控件上的数据绑定集合 IDataBindingsAccessor ,以确定它能否处理的任何特定属性是否是数据绑定的。Most data binding handlers need to examine the data-bindings collection on the control using the IDataBindingsAccessor interface to determine if any specific properties it can handle are data-bound.