ComponentOne WebMenus and WebBars for ASP.NET (2.0) Search HelpCentral 

Populating Tree Items with AJAX

C1WebTreeView item's can be populated on demand statically, dynamically, or in a data-driven tree view. The phrase PopulateOnDemand implies that only the selected nodes that an end-user clicks on are sent to the server. This increases the usability and functionality of the C1WebTreeView by enabling it to handle large amounts of data without affecting the C1WebTreeView's performance. The PopulateOnDemand feature supports the AJAX mechanism which causes the items to load on demand through callbacks rather than postbacks.

Populate On Demand in Static and Data-Driven Tree Items

To enable this feature, in a data-driven or static tree view you set the C1WebTreeViewItem's PopulateOnDemand property to True at design time. For information on using the PopulateOnDemand in a static tree view, see Using PopulateOnDemand for Static Tree Items or Using PopulateOnDemand in a Data-Driven Tree View for information about using the PopulateOnDemand for a data-driven tree view.

Populate On Demand in Dynamic Tree Items

Like static and data-driven tree views, dynamic tree views can also use the PopulateOnDemand feature to enable callbacks. The items can be populated dynamically through the ItemPopulate event. For information on how to accomplish this task, see Using PopulateOnDemand and ItemPopulate for Dynamic Tree Items.

How the PopulateOnDemand Property Functions

AJAX allows C1WebTreeView to load data without having to do a postback to the server, minimizing load time and greatly improving the end-user experience. Using C1WebTreeView's PopulateOnDemand feature, the tree items call back to the server to retrieve only the information that is requested. Unlike with a server postback, where the whole page must be reloaded to update the C1WebTreeView. End-users can quickly expand and collapse nodes in the C1WebTreeView without seeing the screen flicker during load time.

Visual Cues During CallBacks

You can use a visual cue to show the callback is working when the user clicks something that triggers AJAX actions. For example, C1WebTreeView has two properties, CallbackWaitImageUrl and CallbackWaitControlID that can be set to provide visual feedback and enhance the application.

The CallbackWaitImageUrl property shows a default spinner  when the AJAX action is triggered. This improves the usability of the Web application by allowing the user to see the AJAX action performing. You can specify a different image by changing the setting in the CallbackWaitImageUrl property. The CallbackWaitControlID property functions the same way, except that it shows a control rather than an image.

Note: If both the CallbackWaitControlID and CallbackWaitImageURL properties are set, CallbackWaitControlID takes precedence over the CallbackWaitImageURL, and only the control appears.

For information on how to use the CallbackWaitImageUrl or the CallbackWaitImageURL properties, see Using Visual Cues During a CallBack.


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