Would it be possible for you to make the appearance of the listbox have the same rounded corner appearance as the combobox when using the "Default" skin?
1 Answer, 1 is accepted
0
Kamen Bundev
Telerik team
answered on 03 Jul 2009, 11:11 AM
Hi Ryan,
By default RadListBox has rounded corners only on its buttons. Unfotunately if use images to make rounded corners, we will need additional 4 elements for each element we want to put rounded corners on and that is too much if we want rounded corners on every item. However with some CSS (and VML in IE) we can get some rounded corners without using additional images. To achieve this, add this CSS to your page: <style type="text/css">
v\:roundrect
{
color: #FFF;
display: inline-block;
background-color: #FFF;
position: absolute;
z-index: 0;
And this javascript just after the RadScriptManager: <script type="text/javascript">
var $ = $telerik.$;
function addRoundedBordersIE(el) {
var $el = $(el);
var borderRadius = $el.css('-moz-border-radius');
if ($telerik.isIE6)
borderRadius = $el.css('moz-border-radius');
if (borderRadius) {
var pheight = Math.ceil(parseInt(borderRadius) / Math.min($el.width(), $el.height()) * 100);
var halfPHeight = Math.ceil(pheight / 2);
var list = $('.rlbList', el);
var container = $('<div></div>');
container[0].style.cssText = el.style.cssText;
container[0].style.bottom = el.style.bottom;
if ($el.parent().hasClass('RadListBoxButtonAreaBottom'))
$el.parent().prepend(container);
else
$el.parent().append(container);
container.append(roundedRect);
roundedRect.append($el);
}
}
function pageLoad() {
if ($telerik.isIE) {
if (!document.namespaces['v'])
document.namespaces.add('v', 'urn:schemas-microsoft-com:vml');
// We have to stop _preInitialize in IE6 or it gets resized back.
if ($telerik.isIE6)
Telerik.Web.UI.RadListBox._preInitialize = function(elementId, scrollPositon) {};