RadNumericTextBox Width

6 posts, 0 answers
  1. Mac
    Mac avatar
    36 posts
    Member since:
    Nov 2006

    Posted 16 Oct 2007 Link to this post

    Just an observation but it seems slightly unusual that the width property of the RadNumericTextBox control includes the Label. I might be slow but it took me a while to realise why all my inputs were so teeny.

    Including a labelwidth property or just leaving it to the LabelCssClass to set in my head makes more sense.

    Just my 2 cents!
  2. Petja
    Petja avatar
    631 posts

    Posted 18 Oct 2007 Link to this post

    Hello Mac,

    Thank you for contacting us and for your feedback.
    The RadInput controls have a css class (radLabelCss_[SkinName]) which is rendered to its label component but if you set width as its setting it will not be respected due to the specific rendering and always will be as wide as the text  value of the Label is. We consider that this is a better approach because if there is a property LabelWidth it should be always set with the exact label text width (in order to achieve the label text to be prior to the input component and not to be cut by it) but precise text width can not be counted so easily. As the label is a part of control, its width should be also a part of the control width with the current version of the control. We will investigate the problem further and if there is a solution to preserve the input width not to be related to the label one. Your Telerik points are updated.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Shaun Peet
    Shaun Peet avatar
    571 posts
    Member since:
    Aug 2004

    Posted 22 Oct 2007 Link to this post

    IMHO since the RadTextBox is a replacement for the standard TextBox, the Width property should affect the same changes and therefore the Width ought to specify the width of the box itself - not the the label, spinbuttons, or buttons.
  4. Petja
    Petja avatar
    631 posts

    Posted 23 Oct 2007 Link to this post

    Hello Shaun Peet,

    As the buttons and the label are parts of the control and someone sets Width="100%" he/she expects this width to affect the entire control including the buttons and the label, which is why the Width of the RadInput control affects all control's components (if they are set). Concerning the Label width, you could control it by its css class: radLabelCss_[SkinName]. Note that it should have set display mode (which is a browser specific setting) in order to apply the defined width, i.e.:
    <head runat="server"
        <style type="text/css"
            display: inline-block; 
            width: 50px;        
    <body class="body"
        <form runat="server" id="mainForm" method="post">         
            <radI:radtextbox id="RTB1" runat="server" label="label"
    When the Label property is set, an accessibility label with for tag for the textbox component of the input is rendered. You can see from the following code that even if you use label outside of the RadInput control for it (not using the Label property) and set its width it will not be affected until you set display mode too:
    <i>Label width not respected set width of 200px: </i><br /> 
    <label id="Label1" for="RTB2_text" style="width: 200px;">Label</label> 
    <radI:RadTextBox ID="RTB2" runat="server"
    <br /> 
    <i>Label with width of 200px: </i><br /> 
    <label id="Label2" for="RTB2_text" style="width: 200px; display:inline-block;">Label</label> 
    <radI:RadTextBox ID="RadTextBox1" runat="server"

    Let us know if you have further questions.

    Sincerely yours,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. George
    George avatar
    2 posts
    Member since:
    Jul 2007

    Posted 18 Jun 2009 Link to this post

    OK -- Two problems -- First -- your design time veiw is VS 2008 does not show the label correct;y of it has spaces in it.  Second, you control does not appear follow normal style convention regarding centering.  In the following example - the Div, table and text all correctly allgin to the center.  You control however does not.



    @ Page Language="VB" AutoEventWireup="false" CodeFile="TextCenter.aspx.vb" Inherits="TextCenter" %>



    @ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" %>






    DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">




    html xmlns="http://www.w3.org/1999/xhtml">




    head runat="server">






    <title>Untitled Page</title>














    <form id="form1" runat="server">






    <div style="margin-left: 5px ; margin-right: 5px ;">






    <div style="width: auto; text-align:center;">






    <radI:RadNumericTextBox Label="My Label 1: "






    ID="RadNumericTextBox1" runat="server" >

















    This is a test


    <table border="1px" style="margin-left:auto; margin-right:auto;text-align:center;">












    <td> test </td>






    <td> test </td>





































  6. Dimo
    Dimo avatar
    8458 posts

    Posted 19 Jun 2009 Link to this post

    Hello George,

    Thanks for the code snippet.

    The ongoing development of the old ("classic") RadControls for ASP.NET has been discontinued for almost 2 years. As a result, you may experience problems in VS 2008 design time or IE8, as these have been released afterwards. Currently we fix only critical issues related to functionality. Upgrading to the new RadControls for ASP.NET AJAX, especially for new web applications is highly recommended for a number of reasons - features, performance, etc.

    Regarding the browser centering, I suppose you see the problem in IE8 (at least I don't see a problem in other browsers, see attachment). Please use the classic RadControls with a IE8 compatibility meta tag, so that the browser behaves like IE7.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top