Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
WebDataMenu
posted

Hello,

Please help to create data menu items from the server side.

In old version 9.1 I was able to create menu on the server side like this:

Menu.SeparatorStyle.Height = Unit.Pixel(1)

Menu.SeparatorStyle.BackgroundImage = ResolveUrl("~/pagelib/images/ig_menuSep.gif")

Menu.AutoPostBack = True

Menu.TargetFrame = URLTarget

Menu.EnhancedRendering = True

And creating the DataMenuItem:

Dim _mnuItem As New Infragistics.WebUI.UltraWebNavigator.Item

_mnuItem.ImageUrl = ResolveUrl("~/pagelib/images/icon_home.gif")

_mnuItem.TargetUrl = ResolveUrl(PageLibGlobals.HomeUrl)

_mnuItem.Tag = "MENU_HOME_ROOT"

_mnuItem.Style.Width = Unit.Pixel(20)

_mnuItem.Style.Height = Unit.Pixel(20)

Menu.Items.Insert(0, _mnuItem)

 

Most of these properties I don`t see in Infragistics.Web.UI.NavigationControls.DataMenuItem (version 13.2). What are the suitable properties in new control? especially _mnuItem.Style.Width

Parents
  • 20255
    Offline posted

    Hello,

    Thank you for using our forum.

    Our new WebDataMenu have some different options which do not have equivalents, although you can achieve them easily. Below you will find the equivalent code for that you have provided.

    Code snippet:

    Protected Sub Page_Load(sender As Object, e As EventArgsHandles Me.Load
            Dim _mnuItem As New DataMenuItem
     
            _mnuItem.ImageUrl = ResolveUrl("~/pagelib/images/icon_home.gif")
     
            '_mnuItem.TargetUrl = ResolveUrl(PageLibGlobals.HomeUrl)
     
            '_mnuItem.NavigateUrl = ResolveUrl(PageLibGlobals.HomeUrl)
            '_mnuItem.Target = "_blank"
     
     
            '_mnuItem.Tag = "MENU_HOME_ROOT"
            'There is no longer such Tag attribute, my suggestion is to use 
     'Value instead. Text that actually appears on the data menu 
     'item is the Text 
            'property.  There is another property, called Value, that simply 
     'stores information. 
     'It is available on the client as menuItem.get_value().  
            'Simply put your extra information in there.
            _mnuItem.Value = "MENU_HOME_ROOT"
     
            '_mnuItem.Style.Width = Unit.Pixel(20)
            '_mnuItem.Style.Height = Unit.Pixel(20)
            'You should use CssClass in order to set a style to the menu item
            _mnuItem.CssClass = "someClass"
     
            'Menu.Items.Insert(0, _mnuItem)
            WebDataMenu1.Items.Add(_mnuItem)
     
        End Sub

    Let me know of I may be of further assistance.

Reply Children
No Data