Views: 1902
Rating: 0

MTDropDownMenu

Submitted By: root
Licence: LGPL

Class for rendering drop down menubars (like those in you OS GUI) using pure CSS (where aplicable) and JavaScript (for IE, which does not support :hover).

Files
2.89 KB
364 downloads
MTDropDownMenu.zip



Info

MTDropDownMenu class.

Class for rendering drop down menubars (like those in you OS GUI) using pure CSS (where aplicable) and JavaScript (for IE, which does not support :hover).

If you are using this component then you MUST ensure you have System.Web.UI.THead in your template or it will not work.

It is best practise to always specify CssClass for this component so existing ul tags would not get MTDropDownMenu CSS applied.

You can add MTDropDownMenuItem and MTDropDownMenuSeparator as controls children.

Properties:

    * MenuWidth, string
      sets width of menu items
    * CssClass, string, kept in viewstate
      sets class property of control. This must be unique if you have two menus with different MenuWidth's.

Code example:

Code:
       <com:MTDropDownMenu>
         <com:MTDropDownMenuItem HyperLink.Text="Link 1"
         HyperLink.NavigateUrl="?page=Page.1">
               <com:MTDropDownMenuItem HyperLink.Text="SubLink 1" />
               <com:MTDropDownMenuItem HyperLink.Text="SubLink 2" />
            </com:MTDropDownMenuItem>
         <com:MTDropDownMenuItem HyperLink.Text="Link 2"
         HyperLink.NavigateUrl="?page=Page.2" />
       </com:MTDropDownMenu>

MTDropDownMenuItem class.

Provides items which can be added to MTDropDownMenu control. Items can be nested. For example lookup MTDropDownMenu.

Properties:

    * HyperLink.*, System.Web.UI.WebControls.THyperLink inside this control.
    * HasControlsClass, string,
      if this component has child controls it sets CssClass property to HasControlsClass. Default: 'HasControls'.
    * ZIndex, integer
      z-index CSS tag for ul HTML tag (submenu). Each level gets automatically incremented. Starts from 1.

MTDropDownMenuSeparator class.

This control is MTDropDownMenuItem which acts as separator. It renders hr HTML tag.

This component cannot have any child controls neither it has any properties.



Please note: This is currently a beta preview and has known bugs. Please see the PRADO forums if you have suggestions or problems using it.