Textbox width set to percentage server side error

2 posts, 0 answers
  1. Mych
    Mych avatar
    18 posts
    Member since:
    Sep 2012

    Posted 03 Oct 2013 Link to this post

    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?
  2. Mych
    Mych avatar
    18 posts
    Member since:
    Sep 2012

    Posted 03 Oct 2013 Link to this post

    I have fixed this by specifying full path....

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

    Simpelsssss!
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top