In this demo, the buttons are decorated with RadFormDecorator
and are used as opener elements for the 3 RadWindows.
are using the image as an offset element and their position is tuned with the Left property.
By using the OpenerElementID property it is possible to specify
the id of an HTML element that, when clicked, will automatically open the corresponding RadWindow object. The opener can be any element on the page that
has an ID attribute - the property expect a ClientID, so if you are setting it to
a server element, you need to use its ClientID and set it in codebehind:
RadWindow1.OpenerElementID = SofiaBtn.ClientID;
Important: Note that if you set this property to a postback element like asp:Button control, the server-side click event of that element will not fire. Thus we recommend using OpenerElementID in simple scenarios only. OpenerElementID is not suitable for databinding scenarios. For example if you have a standard asp:Repeater control or RadGrid where you need to open RadWindows by clicking some elements in the columns, you will have to declare number of RadWindows equal to the number of the opener elements in the grid. In such scenarios it is recommended to use RadWindow's client-side or server-side API.
You can use the OffsetElementID property 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 property expect a ClientID, so if you are setting it to a server element, you need to use its ClientID:
RadWindow1.OffsetElementID = OffsetElement.ClientID;
The offset can be additionally tuned using the Top and Left properties (to specify offsets in pixels). When OffsetElementID is specified, Top and Left are calculated towards that element's top left corner. If OffsetElementID is not specified, Top and Left are calculated towards the page's top left corner. Top and Left can be used along with the RestrictionZoneID property as well. If the RestrictionZoneID property is set, Top and Left will be calculated towards the top left corner of the restriction zone.