ComponentOne Accordion for ASP.NET Web Forms
Task-Based Help / Expanding Accordion Panes on Hover
In This Topic
    Expanding Accordion Panes on Hover
    In This Topic

    The C1Accordion control allows you to change the event that causes a content area to expand when a header is clicked. Simply set the Event property to take advantage of this feature.

    Possible events include: click, mouseover, dblclick, mousemove, mousedown, mouseup, and mouseout.

    Design Time

    1. Select View | Properties Window.
    2. Next to the Event property, enter an event name, mouseover in this case since we want the content panes to expand when the mouse hovers over the headers.

    In Code

    Add the following code to the Page_Load event, for example, to set the Event property.

     To write code in Visual Basic

    Visual Basic
    Copy Code
    C1Accordion1.Event = "mouseover"

    To write code in C#

    C#
    Copy Code
    C1Accordion1.Event = "mouseover";

    In Markup

    You can add the markup for the Event property directly to the C1Accordion markup. It is automatically added to the markup if you set the property in the page at design time. The markup looks like the following:

    Copy Code
    <cc1:C1Accordion ID="C1Accordion1" runat="server" 
    DataSourceID="AccessDataSource1" Event="mouseover">
    </cc1:C1Accordion>
    

    When you run the application and hover over an accordion header, the content pane expands.

    See Also