Using RadWindow - Show and and specify
location
Showing and initial positioning of the windows are easiliy controlled using 3
properties -
VisibleOnPageLoad,
OffsetElementId,
OpenerElementId. By default, windows are not visible on the
page, and appear centered on the screen. However, the default behavior can
easiliy be changed just by setting a couple of properties and no code at all.
-
Windows can be shown automatically when page loads or show on click (VisibleOnPageLoad)
-
Windows can be shown relative to an html element (OffsetElementId)
-
Codeless opening of windows(OpenerElementId )
...
<
radW:RadWindow
VisibleOnPageLoad
=
"true"
OffsetElementId
=
"HtmlButton"
OpenerElementId="HtmlButton"
Runat
="server"
></
radW:RadWindow
>
<
radW:RadWindow
VisibleOnPageLoad
=
"true"
OffsetElementId
=
"
<%
# ServerButton.ClientID
%>
"
OpenerElementId="<%# ServerButton.ClientID
%>
"
Runat="server"
></radW:RadWindow>
The second RadWindow uses the Page's binding
mechanism, and because of this it is mandatory that the Page.DataBind() method
is called (for example at the end of the Page_Load method).
e.g.:
this.Page.DataBind();
1. Windows can be shown automatically when page loads
Setting the VisibleOnPageLoad property to true
will automatically make the window visible when the page loads
2. Windows can be shown relative to an html element .
Using the OffsetElementId allows for
fine-grained control over the position of a window relative to the rest of the
page element flow. This allows for flexible declarative relative positioning
that is independent of the screen-size and automatically adjusts to the changes
in the page layout. The property should specify the id of an HTML element,
whose top left corner will be used by the window object to positions itself
relatively. The offset can be additionally tuned using the Top
and Left properties (to specify offsets in pixels).
3.Codeless opening of windows
While windows can be easily opened uisng the clientside JavaScript API, RadWindow
also goes a step further in easing the developer.
Using the OpenerElementId property it is possible to
specify the id of an HTML element that, when clicked, will automatically open
the particular RadWindow object.
Note: The OpenerElementId is of string
type and expects to receive the client-side ID of the element. That is, if a
server-side ASP.NET control is used (such as Button, Label, Link or another),
its ClientID propety should be specified. This can be done declaratively in the
following manner: