Add button to titlebar

2 posts, 0 answers
  1. Savyo
    Savyo avatar
    75 posts
    Member since:
    Apr 2012

    Posted 22 Aug 2012 Link to this post

    Hi all,
         I want to add a button on the titlebar of the radwindow to close the radwindow. How do I add a button on the title-bar
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 22 Aug 2012 Link to this post

    Hi Savyo,

    Try the following code snippet to achieve your scenario.

    <style type="text/css">
           background: url(image.gif) !important;
           background: url(image.gif) 0 -26px !important;

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <telerik:RadWindow ID="RadWindow1" runat="server" OnClientShow="OnClientShow" VisibleOnPageLoad="true">

    <script type="text/javascript">
        function OnClientShow(radWindow) {
            var TitleBar = radWindow.GetTitlebar();
            var parent = TitleBar.parentNode;
            var oUL = parent.getElementsByTagName('UL')[0];
            if (!( == "customclosebuttonID")) {
       = "192px";
                var oLI = document.createElement("LI");
       = "customclosebuttonID"
                var A = document.createElement("A");
                A.className = "customclosebutton";
                A.href = "javascript:void(0)";
                A.title = "Close";
                A.onmousedown = closewindow;
                oUL.insertBefore(oLI, oUL.firstChild);
        function closewindow(e) {
            var oManager = GetRadWindowManager();
            var oWnd = oManager.GetWindowByName("RadWindow1");
            return $telerik.cancelRawEvent(e);

    Hope this helps.

Back to Top