ComponentOne ComboBox for ASP.NET: CombBox for ASP.NET Appearance > Using Templates to Embed HTML Controls in C1ComboBox

Using Templates to Embed HTML Controls in C1ComboBox

Templates can be used to embed other HTML controls in the C1ComboBox control. An item, header, or footer template can be used. C1ComboBox includes special template designers for customizing the C1ComboBox header and footer areas. The templates are useful for making the C1ComboBox more coherent to your application and for displaying additional information, such as images.

Item Template

To use an item template, complete the following steps. In this example, we'll add a C1Calendar control to the C1ComboBox.

1.   Click the Source tab to view the source markup for your project.

2.   Add the <ItemsTemplate> tag within the C1ComboBox tags so it looks like the following:

<cc1:C1ComboBox ID="C1ComboBox1" runat="server"

        DataSourceID="AccessDataSource1" TemplateItemHighlighted="True">

       

        <ItemsTemplate>

            <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>

        </ItemsTemplate>

       

    </cc1:C1ComboBox>

Header and Footer Templates

To use header or footer templates, complete the following steps:

1.   Click the C1ComboBox smart tag to open the C1ComboBox Tasks menu.

2.   Click Edit Templates. Template editing mode begins.

 

 

3.   Click the drop-down arrow next to Display to switch between Header Template and Footer Template, depending on which you want to use.

4.   Drag a control into the template area. You can drag and drop arbitrary controls and then modify the control's properties through the Properties window. For example, if you add a Button control, right-click it and select Properties to modify its properties.

5.   Select End Template Editing to end the template editing mode.


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