Skip to main content
Tab

ASPxSplitter.EnableHierarchyRecreation Property

Gets or sets a value that specifies whether the splitter control recreates the hierarchy of its child controls, to apply their programmatically defined settings.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(true)]
public bool EnableHierarchyRecreation { get; set; }

Property Value

Type Default Description
Boolean true

true if recreation of the control hierarchy is enabled; otherwise, false.

Remarks

When you modify the ASPxSplitter‘s properties programmatically at runtime, the ViewState is utilized to remember the state change. Across a postback, the control hierarchy is recreated. After that, the page’s view state is applied.

If the control settings are modified, changing the child controls hierarchy (e.g. add panes), the hierarchy must be recreated again after the ViewState is loaded; otherwise, the control may function improperly.

Set the EnableHierarchyRecreation property to true, to forcibly recreate the control hierarchy after the ViewState is loaded (after a postback).

Note

Set the EnableHierarchyRecreation property in a markup or at runtime in the page’s Init event (before the ViewState is loaded).

Example

In the example below, panes are added programmatically at runtime when the Add a Pane button is clicked. The information about the added panes is remembered in a ViewState. When the PostBack button is clicked, the splitter control’s hierarchy is recreated with its server state (with two panes) across the postback. Then, the ViewState is loaded. In this case, the EnableHierarhyRecreation property must be set to true, to recreate the hierarchy after the ViewState is loaded.

<dx:ASPxSplitter ID="MySplitter" runat="server" EnableHierarchyRecreation="True">
     <Panes>
          <dx:SplitterPane />
          <dx:SplitterPane />
     </Panes>
</dx:ASPxSplitter>

<dx:ASPxButton ID="AddPane" runat="server" onclick="AddPane_Click" Text="Add a Pane" />
<dx:ASPxButton ID="PostBack" runat="server" onclick="PostBack_Click" Text="PostBack" />
protected void AddPane_Click(object sender, EventArgs e) {
     MySplitter.Panes.Add();
}
protected void PostBack_Click(object sender, EventArgs e) {
     ...
}
See Also