ComponentOne WebMenus and WebBars for ASP.NET: WebMenus and WebBars for ASP.NET Task-Based Help > AJAX Tasks > Using the PopulateOnDemand Property > Applying PopulateOnDemand to C1WebTreeView Items

Applying PopulateOnDemand to C1WebTreeView Items

With the PopulateOnDemand feature enabled, clicking on an item in the tree-view at run time sends the items to the server and back to the client. This avoids the postbacks and improves the performance of the C1WebTreeView. The PopulateOnDemand property can be set using the designer or through code. Click on either of the following links to expand the steps for the designer or for the code.

To assign PopulateOnDemand to C1WebTreeView items at design time:

1.   Right-click on the C1WebTreeView and select Edit. The C1WebCommandEditor Appears.

2.   Select a tree view Item from the Members list and then set its PopulateOnDemand property to True.

To programmatically assign PopulateOnDemand to C1WebTreeView items:

Enter the following line of code to enable the PopulateOnDemand property for the first sub-tree item.

      Visual Basic

Dim subitem As C1WebTreeViewItem()

subitem = CType(item.ChildGroup.Items(0), C1WebTreeViewItem)

subitem.PopulateOnDemand = True

      C#

C1WebTreeViewItem subitem;

subitem = (C1WebTreeViewItem)item.ChildGroup.Items[0];

subitem.PopulateOnDemand = true;

Enter the following code to enable the PopulateOnDemand property for all of the items in C1WebTreeView.

      Visual Basic

For Each item As C1WebTreeViewItem In C1WebTreeView1.Items

   item.PopulateOnDemand = True

Next

      C#

foreach (C1WebTreeViewItem item in C1WebTreeView1.Items)

  {

 

   item.PopulateOnDemand = true;

   }


Send comments about this topic to ComponentOne.
Copyright © 1987-2009 ComponentOne LLC. All rights reserved.