Esempio n. 1
0
    protected void ASPxSiteMapControl1_DataBinding(object sender, EventArgs e)
    {
        ASPxSiteMapControl sitemapControl = sender as ASPxSiteMapControl;

        DevExpress.Web.ASPxMenu.MenuItemTemplateContainer container = sitemapControl.NamingContainer as DevExpress.Web.ASPxMenu.MenuItemTemplateContainer;
        (sitemapControl.DataSource as ASPxSiteMapDataSource).StartingNodeUrl = container.Item.NavigateUrl;
    }
Esempio n. 2
0
 public void InstantiateIn(Control container)
 {
     DevExpress.Web.ASPxMenu.MenuItemTemplateContainer c = container as DevExpress.Web.ASPxMenu.MenuItemTemplateContainer;
     DevExpress.Web.ASPxMenu.MenuItem item = c.Item;
     if (String.IsNullOrEmpty(item.NavigateUrl))
     {
         Literal l = new Literal {
             Text = item.Text
         };
         c.Controls.Add(l);
     }
     else if (c.Item.HasChildren)
     {
         string itemText = String.Format("<div onclick=\"javascript:PageRedirectTo(event,\'{0}\')\">{1}</div>",
                                         c.ResolveUrl(item.NavigateUrl), item.Text);
         Literal l = new Literal {
             Text = itemText
         };
         c.Controls.Add(l);
     }
     else
     {
         HyperLink a = new HyperLink {
             NavigateUrl = item.NavigateUrl,
             Text        = item.Text
         };
         c.Controls.Add(a);
     }
 }