The TreeNode click of Asp.net TreeView directly shows the effect of expansion and contraction.

Source: Internet
Author: User

TreeViewThe node text in the control can be in one of two modes: select mode or navigation mode.

By default, a node is selected. To make a node in navigation mode, set the value of the NavigateUrl attribute of the node to a value other than the Null String. To make the node in the selection mode, set the NavigateUrl attribute of the node to a null string.

By default, clicking a node in select mode will send the page back to the server and cause the SelectedNodeChanged event. You can also selectSelectActionAttribute to specify other events. To determine which node is in the selection mode when clicked, use the SelectedNode attribute of the TreeView control.

When the node Is In navigation mode, all selection events of the node are disabled. When you click a Node In navigation mode, the user is directed to the specified URL. You can set the Target attribute to specify the window or frame used to display the link content.

When the node is in the selection mode, useSelectActionAttribute specifies the event triggered when a node is selected. The following table lists available options.

Select Operation

Description

TreeNodeSelectAction. Expand

Switches the expand and collapse statuses of nodes. Trigger the TreeNodeExpanded event or TreeNodeCollapsed event accordingly.

TreeNodeSelectAction. None

No event is triggered when a node is selected.

TreeNodeSelectAction. Select

The SelectedNodeChanged event is triggered when a node is selected.

TreeNodeSelectAction. SelectExpand

The SelectedNodeChanged and TreeNodeExpanded events are triggered when a node is selected. Nodes are displayed only, but not folded.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.