aspnet-devexpress-dot-web-2edc8306.md
Represents a panel control that acts as a container for other controls.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public class ASPxPanel :
ASPxCollapsiblePanel
Public Class ASPxPanel
Inherits ASPxCollapsiblePanel
The ASPxPanel control is a container area for other controls. It is useful when you want to generate controls programmatically, hide/show a group of controls, etc. You can populate the ASPxPanel with other controls using the ASPxPanelContainerBase.Controls property and the PanelContent control.
The ASPxPanel control is available on the DX.25.2: Navigation & Layout toolbox tab in the Microsoft Visual Studio IDE.
Drag the control onto a form and customize the control’s settings, or paste the control markup in the page’s source code.
<dx:ASPxPanel ID="TopPanel" runat="server" Collapsible="true"
FixedPosition="WindowTop" ClientInstanceName="ClientPanel">
<SettingsAdaptivity CollapseAtWindowInnerWidth="624" />
<PanelCollection>
<dx:PanelContent runat="server">
<dx:ASPxMenu ID="HeaderMenu" runat="server">
<Items>
<dx:MenuItem Text="Data"></dx:MenuItem>
<dx:MenuItem Text="Settings"></dx:MenuItem>
<dx:MenuItem Text="Profile"></dx:MenuItem>
<dx:MenuItem Text="Help"></dx:MenuItem>
</Items>
</dx:ASPxMenu>
</dx:PanelContent>
</PanelCollection>
</dx:ASPxPanel>
using DevExpress.Web;
using MenuItem = DevExpress.Web.MenuItem;
...
protected void Page_Load(object sender, EventArgs e) {
ASPxPanel panel = new ASPxPanel();
panel.ID = "TopPanel";
panel.ClientInstanceName = "ClientPanel";
panel.FixedPosition = PanelFixedPosition.WindowTop;
panel.Collapsible = true;
panel.SettingsAdaptivity.CollapseAtWindowInnerWidth = 624;
ASPxMenu menu = new ASPxMenu();
menu.ID = "HeaderMenu";
menu.Items.AddRange(new List<MenuItem>() {
new MenuItem("Data"),
new MenuItem("Settings"),
new MenuItem("Profile"),
new MenuItem("Help")
});
panel.Controls.Add(menu);
Page.Form.Controls.Add(panel);
}
Imports DevExpress.Web
Imports MenuItem = DevExpress.Web.MenuItem
...
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim panel As ASPxPanel = New ASPxPanel()
panel.ID = "TopPanel"
panel.ClientInstanceName = "ClientPanel"
panel.FixedPosition = PanelFixedPosition.WindowTop
panel.Collapsible = True
panel.SettingsAdaptivity.CollapseAtWindowInnerWidth = 624
Dim menu As ASPxMenu = New ASPxMenu()
menu.ID = "HeaderMenu"
menu.Items.AddRange(New List(Of MenuItem)() From {
New MenuItem("Data"),
New MenuItem("Settings"),
New MenuItem("Profile"),
New MenuItem("Help")
})
panel.Controls.Add(menu)
Page.Form.Controls.Add(panel)
End Sub
Note
DevExpress controls require that you register special modules, handlers, and options in the Web.config file. You can change this file or switch to the Design tab in the Microsoft Visual Studio IDE to automatically update the Web.config file. Note that this information is automatically registered if you use the DevExpress Template Gallery to create a project.
The ASPxPanel control inherits all its functionality from the base ASPxPanelBase class. This functionality enables the panel’s child controls to be manipulated (ASPxPanelContainerBase.Controls), the panel’s default button to be specified (ASPxPanelBase.DefaultButton), the panel’s initial visibility on the client to be defined (ASPxPanelBase.ClientVisible) etc. In addition, the ASPxPanel class implements the ASPxCollapsiblePanel.RenderMode property that allows you to specify how the panel should be rendered into the page.
Note
The ASPxPanel control provides you with a comprehensive client-side functionality implemented using JavaScript code:
The control’s client-side API is enabled if the ASPxCollapsiblePanel.EnableClientSideAPI property is set to true, or the ASPxPanelBase.ClientInstanceName property is defined, or any client event is handled.
Show 14 items
Object Control WebControl ASPxWebControlBase ASPxWebControl ASPxPanelContainerBase ASPxPanelBase ASPxCollapsiblePanel ASPxPanel MVCxPanel
See Also