ASPxClientGlobalEvents.ControlsInitialized Event

Occurs on the client side after client object models of all DevExpress web controls contained within the page have been initialized.

Declaration

ControlsInitialized: ASPxClientEvent<ASPxClientControlsInitializedEventHandler<ASPxClientGlobalEvents>>

Event Data

The ControlsInitialized event handler receives an argument of the ASPxClientControlsInitializedEventArgs type. The following properties provide information specific to this event.

Property Description
isCallback Gets a value that specifies whether a callback is sent during a controls initialization.

Remarks

The ControlsInitialized event occurs after all DevExpress controls have been initialized, but prior to them being displayed within the browser. This event fires after all ASPxClientControlBase.Init client events of DevExpress web controls. Note that the ControlsInitialized event is raised even after the a callback's server-side processing has been completed.

A handler of the ControlsInitialized event is the primary place to manipulate all DevExpress web controls using their client-side APIs.

Examples

Note

The complete sample project is available in the DevExpress Code Central example E2391. Depending on the target platform type (ASP.NET, WinForms, etc), you can either run this example online or download an auto-executable sample.

All complicated DevExpress ASP.NET controls like the ASPxHtmlEditor and ASPxSplitter require some time to calculate their sizes on the initial page load. This requirement may cause some effects which may be annoying to users.

For example, the ASPxSplitter may "flicker" during page loading and the ASPxHtmlEditor may show its toolbar in the middle of its space.

This solution allows avoiding these problems and showing all controls only when they are completely initialized and resized.

The main idea is to wrap these controls with an ASPxPanel that is hidden on the client (ASPxPanelBase.ClientVisible = false). When all DevExpress controls are ready, the client-side ASPxClientGlobalEvents.ControlsInitialized event of the ASPxGlobalEvents is raised and the handler of this event may be used to show a panel with the client-side ASPxClientControlBase.SetVisible property.

<dx:ASPxPanel ID="ASPxPanel1" runat="server" Width="100%" Height="100%" ClientVisible="false" ClientInstanceName="clientControlPanel">
     ...
</dx:ASPxPanel>
<dx:ASPxGlobalEvents ID="ASPxGlobalEvents1" runat="server">
     <ClientSideEvents ControlsInitialized="function(s,e){clientControlPanel.SetVisible(true);}" />
</dx:ASPxGlobalEvents>
See Also