0% found this document useful (0 votes)
308 views

TreeView Control in

The TreeView control in ASP.Net allows dynamically creating nodes with a root, parent, and leaf nodes. It has properties and events that allow setting images, checkboxes, and expanding/collapsing nodes. The sample code provided demonstrates how to populate nodes on demand and set properties like ShowCheckBox and Expand to control the TreeView's behavior and rendering.

Uploaded by

Saku Ra
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
308 views

TreeView Control in

The TreeView control in ASP.Net allows dynamically creating nodes with a root, parent, and leaf nodes. It has properties and events that allow setting images, checkboxes, and expanding/collapsing nodes. The sample code provided demonstrates how to populate nodes on demand and set properties like ShowCheckBox and Expand to control the TreeView's behavior and rendering.

Uploaded by

Saku Ra
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

The TreeView control is an object model in ASP.Net which allows creation of nodes dynamically.

It will have the Root, Parent and Leaf. The TreeView control has properties and events. It has some characteristics.

TreeView node can navigate to some other pages The images and properties can be set to the nodes It can have the lines, checkbox and images It can set dynamically expand/collapse The nodes can be created on demand

The sample treeview code. <asp:TreeView ID="TreeView1" runat="server"> <Nodes> <asp:TreeNode Value="Child1" PopulateOnDemand="true" ShowCheckBox="true" Expanded="True" Text="1"> <asp:TreeNode Value="Grandchild1" Text="A" /> <asp:TreeNode Value="Grandchild2" Text="B" /> </asp:TreeNode> <asp:TreeNode Value="Child2" Text="2" /> <asp:TreeNode Value="Child3" Expanded="True" Text="3"> <asp:TreeNode Value="Grandchild1" Text="A" /> </asp:TreeNode> </Nodes> </asp:TreeView> There are some properties that are useful for defining the behavior of the TreeView. These properties are Boolean value based.

1. PopulateOnDemand - It will populate the node under another node on the demand. It will help to increase the performance; it would not create and render at the time of initial loading. 2. ShowCheckBox - This property used to set the check-box is required or not.

3. Expand - It accepts Boolean property to set the node has to be expanded or collapsed at the time of rendering. 4. ShowLines - This is used to show the flow of the nodes in the lines. Let's see an example of the SQL Server TreeView. It will show all the databases in the given SQL Server.

The databases are the parent nodes. All the databases have the child nodes like Tables, Views, Stored procedures, Triggers, Functions.

Every table in the database will have the list of tables underlying the database.

Click of every table will show the schema of the table.

You might also like