You can easily bind C1WebMenu, C1WebToolBar, C1WebTreeView, C1WebTopicBar, or C1WebTabStrip to a data source using the Data Source Configuration Wizard in Visual Studio.
There are two ways to access the wizard, either through the DataSource property in the Properties window or the Choose Data Source box in the Tasks menu for C1WebMenu, C1WebToolBar, C1WebTreeView, C1WebTopicBar, or C1WebTabStrip. For more information on the C1WebMenu, C1WebToolBar, C1WebTreeView, C1WebTopicBar, or C1WebTabStrip Tasks menu, see C1WebCommand2 Smart Tags.
Clicking the drop-down arrow next either the DataSource property in the Properties window or the Choose Data Source box in the any of the C1WebCommand2 Tasks menu allows you to select from a list of available data sources or add a data source to your project.
To add a data source to your project, click New Data Source to open the Data Source Configuration Wizard.
The Data Source Configuration Wizard walks you through adding a data source step by step. The Choose a Data Source Type page allows you to choose from a SiteMap or an XML File to gather information from.
To connect to the Site Map application:
The Site Map connects to the site navigation tree for this application. This requires a valid site map file at the application root.
1. Select the Site Map application from the Choose a Data Source Type.
The wizard adds a SiteMapDataSource ID to the text box.
2. Click OK.
A Root Node and a SiteMapDataSource are added to the C1WebMenu component.
For more information about binding a SiteMapDataSource control to a WebMenu or WebTreeView control, see Bind to a SiteMap.
To connect to the XML File application:
The XML file application connects to an XML file.
1. Select the XML File application from the Choose a Data Source Type.
The wizard adds an XMLDataSource ID to the text box. On this page you can specify an ID for the data source or use the default name provided by the wizard.
2. Click OK.
The Configure Data Source dialog appears.
The Configure Data Source dialog box provides a Data file, Transform file, and an Xpath expression to add a XML data file, transform and/or filter the data in the XML file.
3. To add a XML file click the Browse button next to the Data file text box, then double-click the App_Data item from the Project folders list box. The xml file appears in the Contents of folder list box.
4. Click OK.
The wizard adds the data.xml file to the XmlDataSource1 ID.
5. Click OK.
The Configure loads the configuration file into memory, parses the contents and calls the methods to register the channels and objects described in the data.xml file. The wizard creates the channels and XmlDataSource, and adds them to the C1WebMenu control.
For more information on how to set up the elements in the Bindings Collection Editor, see Bind C1WebTreeView to a XML File.
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |