center radalert button

5 posts, 1 answers
  1. dany7487
    dany7487 avatar
    88 posts
    Member since:
    Jan 2008

    Posted 06 May 2009 Link to this post

    Hi, Telerik.
    I´m using radwindow from asp.net ajax to show a radalert, but I found no way to center the radwindow buttons
    When use this:
    <AlertTemplate>
    <
    div class="windowpopup radalert">   
    <div class="dialogtext">
    {
    1}    
    </div>
    <div>
     
    <a  onclick="$find('{0}').close();"
     
    class="radwindowbutton" href="javascript:void(0);">
      
    <span class="outerspan">
       
    <span class="innerspan">##LOC[OK]##</span>
      
    </span>
     
    </a>    
    </div>
    </
    div>
    </
    AlertTemplate>

    I saw the button to the left (If I insert another button it will appear next to the first on the right and so on with other buttons).
    I want to use only 1 button for the radalert and I want it on the center.
    I broke my head trying to set up this on the alerttemplate with no results.
    Is it possible?
    thanks,
    Daniel.
  2. Answer
    Martin
    Admin
    Martin avatar
    585 posts

    Posted 08 May 2009 Link to this post

    Hello dany7487,

    Unfortunately, at present we cannot offer an out-of-the box approach to center the buttons of the browser dialog boxes of RadWindow. What I mean is that centering of the button is dependent from the width of the button. If your alert boxes are of equal with, this may be easily achieved with CSS. Just play with the settings below:

    .rwPopupButton
    {
       margin-left: 40px !important;
    }


    The greater the width of the box is, the greater the margin should be. Do not remove the !important flag at the end of the property value, otherwise your custom settings will not work.

    Have a great weekend,
    Martin Ivanov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. dany7487
    dany7487 avatar
    88 posts
    Member since:
    Jan 2008

    Posted 08 May 2009 Link to this post

    Hi, Martin.

    That worked for me.
    I set up my skin css as:

    div.radwindow_MySkin

     

    .windowcontent a.radwindowbutton:hover

     

    {

     

    background: transparent url('Window/ModalDialogButtonSprites.gif') no-repeat 0 -64px;

     

     

    padding: 0 0 0 3px;

     

     

    margin: 8px 8px 8px 0;

     

     

    margin-left: 106px !important;

     

    }


    And now I have the button on the center. Thanks a lot.

    I have a new doubt now, I use the following code in order to set the focus to a control once the radalert is closed:

     

    var oWindow = radalert(message, 300, 100, title);

     

     

    if (idclientefoco)//here I have the ClientID of the control that will get the focus

     

    {

     

    //set focus to the control

     

    oWindow.Argument= idclientefoco;

    oWindow.add_close(RWCerrarFoco);

    }

    function

     

    RWCerrarFoco(sender, args)

     

    {

     

    if (sender.Argument != null)

     

    {

     

    var obj= document.getElementById(sender.Argument);

     

     

    if (obj)//set focus

     

        obj.focus();

    }

    }


    With this, the focus goes to the control I want, but when I press TAB on that control, the focus goes to the web address bar of the browser, instead of going to the next control. It seems the focus was not given on the right way or so.
    However, that worked for me when I was using radcontrols for asp.net with no problems.
    Can you give me ideas?
    thanks again,
    Daniel.




  5. Martin
    Admin
    Martin avatar
    585 posts

    Posted 11 May 2009 Link to this post

    Hi dany7487,

    Please, try to set tabIndex to the controls you need to get focused in a certain manner. I believe that this will put things to work. However, if it does not, prepare and send me a small running project along with the controls you need to have focused and detailed instructions of the result you want to achieve.

    Have a great week,
    Martin Ivanov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. dany7487
    dany7487 avatar
    88 posts
    Member since:
    Jan 2008

    Posted 19 May 2009 Link to this post

    Hi, Martin.
    I had another problem that was causing javascript not to work fine.
    Georgi helped me with that and now this is working too!
    thanks a lot!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017