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

RadTextBox too wide

2 Answers 50 Views
Input
This is a migrated thread and some comments may be shown as answers.
Bent
Top achievements
Rank 2
Bent asked on 28 Mar 2009, 12:01 AM
Hi there

I've got a small cosmetic problem regarding the RadTextBox (and possibly others).

Generally all of my controls are 500px wide (translated to 497px), which is set on the Width-property of the controls
Some of controls are hidden through CSS at page load in the code-behind using control.Style[HtmlTextWriterStyle.Display] = "none".

This works as expected, but when I through JavaScript shows the controls by doing

$get("<%=control.ClientID%>").style.display = "";

the controls shows to be 3px wider that the rest of the controls.

It looks like the controls are compensating for the borders when they are rendered vissible, but this doesn't seem to happen when they are hidden.

Is there any way I can force specific controls to calculate their correct widths on page load, even though they're hidden, perhaps through the clientside pageLoad event?

2 Answers, 1 is accepted

Sort by
0
Bent
Top achievements
Rank 2
answered on 28 Mar 2009, 12:11 AM
I figured it out I guess... I simply call the repaint() method when I display the control. That seems to have fixed the problem.
0
Bent
Top achievements
Rank 2
answered on 28 Mar 2009, 12:16 AM
Oh, ant BTW, I found this function using Firebug for Firefox. Kind of annoying it wasn't mentioned anywhere in the documentation.
Tags
Input
Asked by
Bent
Top achievements
Rank 2
Answers by
Bent
Top achievements
Rank 2
Share this question
or