Adding Content to C1DropDown

You can add any sort of arbitrary content to a C1DropDown control. This includes text, images, and other standard and 3rd-party controls. In this example, you'll add a Button control to a C1DropDown control, but you can customize the steps to add other types of content instead.

At Design Time in Blend

To add a Button control to the drop-down box in Blend, complete the following steps:

1.   Click the C1DropDown control once to select it.

2.   Navigate to the Toolbox, and double-click the Button item to add the control to the C1DropDown control.

3.   Notice in XAML view that the button appears in the C1DropDown control’s tag:

<c1:C1DropDown Height="30" Name="c1DropDown1" Width="100">

    <Button Height="23" Name="button1" Width="75">Button</Button>

</c1:C1DropDown>

4.   If you choose, you can customize the C1DropDown and Button controls by selecting each control and setting properties in the Properties window. For example, set the Button's Content property to "Hello World!".

In XAML

For example, to add a Button control to the drop-down box add <Button Height="23" Name="button1" Width="75">Hello World!</Button> within the <c1:C1DropDown> tag so that it appears similar to the following:

<c1:C1DropDown Height="30" Name="c1DropDown1" Width="100">

    <Button Height="23" Name="button1" Width="75">Hello World!</Button>

</c1:C1DropDown>

In Code

For example, to add a Button control to the drop-down box, add code to the page's constructor so it appears like the following:

      Visual Basic

      C#

What You've Accomplished

You've added a button control to the C1DropDown control. Run the application and click the drop-down arrow. Observe that the Button control has been added to the drop-down box. Note that to add multiple items to the C1DropDown control, add a Grid or other panel to the C1DropDown control, and add items to that panel.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.