ComponentOne Menu for ASP.NET Web Forms
Task-Based Help / Working with Templates / Creating an Individual Item Template
In This Topic
    Creating an Individual Item Template
    In This Topic

    In this tutorial, you will learn how to create a template for an individual menu item.

    Note: Individual templates trump global templates, so adding a template to an individual item will preventing formats that you may have used in ItemsTemplatesChildItemsTemplates, and TopItemsTemplates.

    Complete the following steps:

    1. Create a C1Menu control with one top-level menu item. Add two child items to that top-level menu item to create a submenu.
    2. Switch to Source view and add the following markup between the <cc1:C1MenuItem ID="C1MenuItem1"> tags:

      To write code in Source View

       <Template>  
         <div>    
            <a href="#" class="wijmo-wijmenu-text">New</a><span class="wijmo-wijmenu-icon-right">Ctrl+N</span>     </div>
      </Template>
    3. Now add the following markup between the <cc1:C1MenuItem ID="C1MenuItem1"> tags:

      To write code in Source View

      <Template>
           <div>    
            <a href="#" class="wijmo-wijmenu-text">Close</a><span class="wijmo-wijmenu-icon-right">Ctrl+C</span>     </div>
      </Template>
    4. Press F5 to run the project. When the project loads, click the top-level menu item to open its submenu and observe that the two menu items have adopted the templates you specified.

      Template