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

Maybe a bug in RadComboBox

3 Answers 48 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bogdan Cucosel
Top achievements
Rank 1
Bogdan Cucosel asked on 02 Jun 2010, 03:33 PM
Hello,

I'm using version 2010.1.309.35 of the RadControls.

Using reflector in the method RenderTable of RadComboBox I can see:

   if (this.Label.Length > 0) 
    { 
        if (this.Width == Unit.Empty) 
        { 
            str = str + string.Format("width:160px"new object[0]); 
        } 
        else if (this.Width.Type != UnitType.Percentage) 
        { 
            str = str + string.Format("width:{0}{1}"this.Width.Value, "px"); 
        } 
        str = str + "display:none"
    } 
 

the str is afterwards assigned to the style of the table.

The problem is that in neither line that sets the width there is no ; at the end of the width. After "display:none" is also added and I would get something like width:60pxdisplay:none. (And I dont know why the display:none)

Anyway my problem is that in the browser the width is something like 177px and I don't know where that comes from.

Please advise,
Thank you

3 Answers, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 07 Jun 2010, 06:34 PM
Hello Bogdan Cucosel,

I will recommend you to use following approach in case of concatenating a few strings with delimiters

var styleParts = new List<string>();
  
styleParts.Add("width: 160px");
  
if ("some condition")
{
    styleParts.Add("another styles without delimiters");
}
  
// ...
  
string style = String.Join(";", styleParts.ToArray());

In this way you will always have correctly placed delimiters and definitely more effective code.
Concatenating strings with “+=” is recommended only with simpler scenarios.

Greetings,
Kalina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Bogdan Cucosel
Top achievements
Rank 1
answered on 08 Jun 2010, 07:55 AM
Hello,

The code snippet provided by me is from the Telerik code, it's not mine. So when I have a Label this code is run and it is problematic.

10x
0
Kalina
Telerik team
answered on 08 Jun 2010, 01:11 PM
Hello Bogdan Cucosel,

Could you please provide us a sample running page that reproduces the issue and more details about your implementation? We need to inspect your code in order to suggest you a solution.

At ticket properties I can see that you use RadControls for ASP.NET AJAX version 2010.1.519 - could you please confirm this?

Regards,
Kalina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Bogdan Cucosel
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Bogdan Cucosel
Top achievements
Rank 1
Share this question
or