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

RadListBox Width Setting Problem 2015.1.401

3 Answers 217 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Shawn R.
Top achievements
Rank 1
Shawn R. asked on 01 May 2015, 06:20 PM

I'm using 2015.1.401 and I have several RadListBoxes throughout my project with a width setting of 100px. The problem is that they now appear to not go below a width of around 140px. I created a simple page I created to rule out all other possibilities.

 

 

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm9.aspx.vb" Inherits="PWOnline.WebForm9" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
 
<body>
    <form id="form1" runat="server">
 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
 
        <div>
            <telerik:RadListBox ID="RadListBox1" runat="server" Height="250px" Width="50px">
            </telerik:RadListBox>
        </div>
 
    </form>
</body>
</html>

 

Even at this 50px setting it renders as this: http://imgur.com/k3SKVZF

You can increase the width, but it never goes lower than about 140px now. I didn't see this listed as a known issue in any searches I performed. I was able to get it to look correctly by using CSS and "max-width", but this only made it look correct but the effective width of the control remained about 140px. What I mean is that it rendered at 50px but there was a "ghost" width of 140px as any control placed to the right of the list box couldn't be interacted with for the first 90 pixels.

 

Anyone else experience this or have a work around?

 

TIA

 

3 Answers, 1 is accepted

Sort by
1
Magdalena
Telerik team
answered on 04 May 2015, 08:30 AM
Hello  Shawn,

Because of establishing a minimal width to RadListBox control, there is a min-width CSS property in our inbuilt styles set to 140 pixels. To reset this value, please apply the following:
html .RadListBox {
    min-width: 0;
}


Regards,
Magdalena
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Shawn R.
Top achievements
Rank 1
answered on 04 May 2015, 12:31 PM
Thanks for the response. Using the suggestion, it appears as though the width setting of the RadListBox is then ignored and it acts as "auto-fit". I only have one on the page so I made min-width the width I wanted, but I would most likely have to create a style for each RadListBox if I wanted different sizes. Thanks for you help. 
0
Magdalena
Telerik team
answered on 05 May 2015, 10:44 AM
Hello Shawn,

The min-width property only limits a minimal width that would be rendered. If you set a width that is wider as the min-width, the width value will be applied. It will not be applied only if the width value is narrower as the min-width value. In this case, the element will be with a min-width value.

We have attached a sample project where different RadListBox has different width values and all of them are set the min-width property to zero.

Regards,
Magdalena
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
ListBox
Asked by
Shawn R.
Top achievements
Rank 1
Answers by
Magdalena
Telerik team
Shawn R.
Top achievements
Rank 1
Share this question
or