3 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 06 Jan 2014, 10:26 AM
Hi Rahul,
Please have a look into the following code snippet to achieve your scenario.
ASPX:
CSS:
Thanks,
Shinu.
Please have a look into the following code snippet to achieve your scenario.
ASPX:
<
asp:Label
ID
=
"Label1"
runat
=
"server"
Text
=
"TextBox"
>
</
asp:Label
>
<
telerik:RadTextBox
ID
=
"RadTextBox1"
runat
=
"server"
CssClass
=
"textbox"
>
</
telerik:RadTextBox
>
<
br
/>
<
asp:Label
ID
=
"Label2"
runat
=
"server"
Text
=
"TextArea"
>
</
asp:Label
>
<
telerik:RadTextBox
ID
=
"RadTextBox2"
runat
=
"server"
TextMode
=
"MultiLine"
CssClass
=
"textarea"
>
</
telerik:RadTextBox
>
CSS:
<style type=
"text/css"
>
.textbox
{
border
:
1px
solid
red
!important
;
height
:
25px
!important
;
}
.textarea
{
border
:
1px
solid
blue
!important
;
height
:
50px
!important
;
width
:
75%
!important
;
}
</style>
Thanks,
Shinu.
0

Rahul
Top achievements
Rank 1
answered on 07 Jan 2014, 05:01 AM
Hi Shinu,
Thanks for code but one more thing is can apply the height in percentage to Text Box and TextArea.
Thanks,
Rahul
Thanks for code but one more thing is can apply the height in percentage to Text Box and TextArea.
Thanks,
Rahul
0

Shinu
Top achievements
Rank 2
answered on 07 Jan 2014, 10:46 AM
Hi Rahul,
It is not possible to set the height of RadTextBox in percentage and we can only set 100% as the RadTextBox height and it will not work with TextArea. As a work around you can try the following code snippet.
ASPX:
JavaScript:
Thanks,
Shinu.
It is not possible to set the height of RadTextBox in percentage and we can only set 100% as the RadTextBox height and it will not work with TextArea. As a work around you can try the following code snippet.
ASPX:
<
telerik:RadTextBox
runat
=
"server"
ID
=
"RadTextBox1"
TextMode
=
"MultiLine"
Height
=
"100%"
ClientEvents-OnLoad
=
"OnLoad"
/>
<
telerik:RadTextBox
runat
=
"server"
ID
=
"RadTextBox2"
Height
=
"100%"
/>
JavaScript:
<script type=
"text/javascript"
>
function
OnLoad(sender) {
var
height = parseInt(document.getElementById(
'RadTextBox1'
).clientHeight) + 50;
sender._originalTextBoxCssText =
"height:"
+ height +
"px"
;
sender.updateCssClass();
}
</script>
Thanks,
Shinu.