This is a migrated thread and some comments may be shown as answers.

center radalert button

4 Answers 116 Views
Window
This is a migrated thread and some comments may be shown as answers.
dany7487
Top achievements
Rank 1
dany7487 asked on 06 May 2009, 09:19 PM
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.

4 Answers, 1 is accepted

Sort by
0
Accepted
Martin
Telerik team
answered on 08 May 2009, 05:33 AM
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.
0
dany7487
Top achievements
Rank 1
answered on 08 May 2009, 10:03 PM
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.




0
Martin
Telerik team
answered on 11 May 2009, 06:28 AM
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.
0
dany7487
Top achievements
Rank 1
answered on 19 May 2009, 04:39 PM
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!
Tags
Window
Asked by
dany7487
Top achievements
Rank 1
Answers by
Martin
Telerik team
dany7487
Top achievements
Rank 1
Share this question
or