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.
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;
· Delphi
var
subitem : C1WebTreeViewItem
begin
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.
For Each item As C1WebTreeViewItem In C1WebTreeView1.Items
item.PopulateOnDemand = True
Next
· C#
foreach (C1WebTreeViewItem item in C1WebTreeView1.Items)
{
item.PopulateOnDemand = true;
}
· Delphi
for i := 0 to C1WebTreeView1.Items.Count - 1 do
item[i].PopulateOnDemand := true;
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |