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 C1WebTopicBar Groups

Applying PopulateOnDemand to C1WebTopicBar Groups

With the PopulateOnDemand feature enabled, clicking on a group in the topic bar at run time sends the content for the group to the server and back to the client. This avoids the postbacks and improves the performance of the C1WebTopicBar. The PopulateOnDemand property can be set through the designer or through code.

To assign PopulateOnDemand to C1WebTopicBar groups at design time:

1.   Right-click on the C1WebTopicBar and select Edit Groups. The C1WebTopicBarGroup Collection Editor appears.

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

To programmatically assign PopulateOnDemand to C1WebTopicBar groups:

Enter the following line of code to enable the PopulateOnDemand property for a specific C1WebTopicBar group:

      Visual Basic

CType(TopicBar.Groups(0), C1.Web.Command.C1WebGroupHeader).PopulateOnDemand = True

      C#

((C1.Web.Command.C1WebGroupHeader)TopicBar.Groups[0]).PopulateOnDemand = true;

Enter the following code to enable the PopulateOnDemand property for all groups in the C1WebTopicBar:

      Visual Basic

For Each group As C1.Web.Command.WebGroupHeader In TopicBar.Groups

   group.PopulateOnDemand = True

Next

      C#

foreach (C1.Web.Command.C1WebGroupHeader group in TopicBar.Groups)

   {

 

    group.PopulateOnDemand = true;

   }


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