Removing extra space in radnumerictextbox

4 posts, 1 answers
  1. RJ
    RJ avatar
    386 posts
    Member since:
    Oct 2006

    Posted 02 Jul 2013 Link to this post

    Hi All,
    How can I remove extra space in my radnumerictextbox. Whenever I change the width of the textbox it only applies to my textbox but there still about 80px of space after the spinbuttons. I am adding an imagebutton beside it but then it has huge gap between the spinbuttons and the icon and it doesnt look good. Heres the code. Thanks in advance.
    <telerik:RadNumericTextBox ID="rntNumber" ShowSpinButtons="true" Width="50px" MaxLength="3" runat="server" Value="50" MinValue="10" MaxValue="200" NumberFormat-DecimalDigits="0">
     </telerik:RadNumericTextBox>
    <asp:ImageButton ID="infoBtn" runat="server" width="20px" height="20px" BorderWidth="0px" ImageUrl="../Images/Info.gif" />
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 03 Jul 2013 Link to this post

    Hi RJ,

    Try shifting the icon of the ImageButton to the left by setting an appropriate value to the margin-left CSS property. Please check the following sample code.

    ASPX:
    <telerik:RadNumericTextBox ID="rntNumber" ShowSpinButtons="true" Width="50px" MaxLength="3"
        runat="server" Value="50" MinValue="10" MaxValue="200" NumberFormat-DecimalDigits="0">
    </telerik:RadNumericTextBox>
    <asp:ImageButton ID="infoBtn" runat="server" Width="20px" Height="20px" BorderWidth="0px"
        CssClass="styleIcon" ImageUrl="~/Images/Close.png" />

    CSS:
    <style type="text/css">
        .styleIcon
        {
            margin-left: -10px;
        }
    </style>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. RJ
    RJ avatar
    386 posts
    Member since:
    Oct 2006

    Posted 03 Jul 2013 Link to this post

    Thanks a lot Shinu.
  5. RJ
    RJ avatar
    386 posts
    Member since:
    Oct 2006

    Posted 03 Jul 2013 Link to this post

    Thanks a lot Shinu, css did the trick.
Back to Top