TreeView.OnTreeNodeExpanded(TreeNodeEventArgs) 方法
定义
引发 TreeView 控件的 TreeNodeExpanded 事件。Raises the TreeNodeExpanded event of the TreeView control.
protected:
virtual void OnTreeNodeExpanded(System::Web::UI::WebControls::TreeNodeEventArgs ^ e);
protected virtual void OnTreeNodeExpanded (System.Web.UI.WebControls.TreeNodeEventArgs e);
abstract member OnTreeNodeExpanded : System.Web.UI.WebControls.TreeNodeEventArgs -> unit
override this.OnTreeNodeExpanded : System.Web.UI.WebControls.TreeNodeEventArgs -> unit
Protected Overridable Sub OnTreeNodeExpanded (e As TreeNodeEventArgs)
参数
包含事件数据的 TreeNodeEventArgs。A TreeNodeEventArgs that contains event data.
注解
在 TreeNodeExpanded 控件中展开节点时,将引发事件 TreeView 。The TreeNodeExpanded event is raised when a node is expanded in the TreeView control. 这使你可以提供一种事件处理方法,该方法可在每次发生此事件时执行自定义例程。This allows you to provide an event-handling method that performs a custom routine whenever this event occurs.
备注
如果 SelectAction 将节点的属性设置为 Expand 或,则 SelectExpand TreeNodeExpanded 当在控件中单击该节点时,也会引发该事件 TreeView 。If the SelectAction property for a node is set to Expand or SelectExpand, the TreeNodeExpanded event is also raised when that node is clicked in the TreeView control.
引发事件时,将通过委托调用事件处理程序。Raising an event invokes the event handler through a delegate. 有关如何处理事件的详细信息,请参阅 处理和引发事件。For more information about how to handle events, see Handling and Raising Events.
OnTreeNodeExpanded 方法还允许派生类对事件进行处理而不必附加委托。The OnTreeNodeExpanded method also allows derived classes to handle the event without attaching a delegate. 这是在派生类中处理事件的首选技术。This is the preferred technique for handling the event in a derived class.
继承者说明
当在 OnTreeNodeExpanded(TreeNodeEventArgs) 派生类中重写方法时,请确保调用 OnTreeNodeExpanded(TreeNodeEventArgs) 基类的方法,以便注册的委托接收事件。When overriding the OnTreeNodeExpanded(TreeNodeEventArgs) method in a derived class, be sure to call the OnTreeNodeExpanded(TreeNodeEventArgs) method for the base class so that registered delegates receive the event.