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

Textbox width set to percentage server side error

1 Answer 637 Views
Input
This is a migrated thread and some comments may be shown as answers.
Mych
Top achievements
Rank 1
Mych asked on 03 Oct 2013, 11:57 AM
Hi I have a RadTextBox that has a Width set to 100%

<telerik:RadTextBox ID="tb_Tools" runat="server" ReadOnly="true" Width="100%"></telerik:RadTextBox>

In certain scenarios I need to change this to 90% so in my code behind I have the following in an If Then Statement....
If condition Then
    tb_Tools.Width = Unit.Percentage(90)
End If
Unfortunately in Visual Studio I get a wavy line under Unit.Percentage(90) and a ToolTips error stating....

Value of Type 'Telerik.Charting.Styles.Unit' cannot be converted to 'System.Web.UI.WebControls.Unit'.

What have I done wrong?

1 Answer, 1 is accepted

Sort by
0
Mych
Top achievements
Rank 1
answered on 03 Oct 2013, 01:59 PM
I have fixed this by specifying full path....

If condition Then
    tb_Tools.Width = System.Web.UI.WebControls.Unit.Percentage(90)
End If

Simpelsssss!
Tags
Input
Asked by
Mych
Top achievements
Rank 1
Answers by
Mych
Top achievements
Rank 1
Share this question
or