Tab

NavBarGroup(String) Constructor

Initializes a new instance of the NavBarGroup class using the specified display text.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v21.1.dll

Declaration

public NavBarGroup(
    string text
)

Parameters

Name Type Description
text String

A String value specifying the group’s display text. Initializes the group’s NavBarGroup.Text property.

Remarks

Use this constructor to initialize a new instance of a NavBarGroup class using the setting passed via the parameter.

Example

This example demonstrates how to modify the ASPxNavBar‘s item content.

protected void Page_Load(object sender, EventArgs e){
     NavBarGroup group1 = new NavBarGroup("Help");
     NavBarItem item1 = new NavBarItem("Search");
     NavBarItem item2 = new NavBarItem("FAQ", "faq", "~/Images/faq.gif", "Faq.aspx", "_blanc");
     NavBarItem item3 = new NavBarItem("Forum", "forum", "~/Images/Forum.gif");
     item3.NavigateUrl = "~/Forum/Default.aspx";
     item3.Target = "_blanc";      

     ASPxNavBar1.Groups.Add(group1);
     group1.Items.Add(item1);
     group1.Items.Add(item2);
     group1.Items.Add(item3);

     item1.Template = new MyTemplate();
}

public class MyTemplate : ITemplate {
     void ITemplate.InstantiateIn(Control container) {
          ASPxTextBox MyTextBox = new ASPxTextBox();
          MyTextBox.Text = "";
          ASPxButton SearchButton = new ASPxButton();
          SearchButton.Text = "Search..";
          SearchButton.AutoPostBack = false;
          container.Controls.Add(MyTextBox);
          container.Controls.Add(SearchButton);
     }
}
See Also