RadNumericTextbox Decimal points

Thread is closed for posting
2 posts, 0 answers
  1. Nagendra
    Nagendra avatar
    35 posts
    Member since:
    Jan 2011

    Posted 15 Mar 2011 Link to this post


    In my radgrid i used Radnumerictextbox. In this numeric textbox i need to display 4 decimal points like 0.0000 or 99.9999.
    but if value is 99.9999, it show's like 9.9999. I need like "99.9999". (Two numbers before decimal point).

    For this i taken property DecimalDigits="4".

    <telerik:GridTemplateColumn UniqueName="perComplete" HeaderText="Percent Complete" AllowFiltering="false">
           <telerik:RadNumericTextBox ID="pct" runat="server" Text='<%#Eval("pct") %>' MinValue="0" MaxValue="100" Width="50px">
              <NumberFormat AllowRounding="true" DecimalDigits="4" />  

  2. Martin
    Martin avatar
    822 posts

    Posted 16 Mar 2011 Link to this post

    Hello Nagendra,

    I have tried to reproduce the issue locally using the code bellow but without success. Please review it and let me know whether I miss something.

    <%@ Page Language="C#" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <head id="Head1" runat="server">
        <form id="mainForm" runat="server">
        <asp:ScriptManager runat="server" ID="ScriptManager1">
        <script type="text/C#" runat="server">
            protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
                System.Data.DataTable table = new System.Data.DataTable();
                table.Columns.Add("ID", typeof(int));
                table.Columns.Add("pct", typeof(Double));
                table.Rows.Add(1, 9.9999);
                table.Rows.Add(2, 99.9999);
                table.Rows.Add(3, 19.9999);
                table.Rows.Add(4, 5.9999);
                RadGrid1.DataSource = table;
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" OnNeedDataSource="RadGrid1_NeedDataSource">
                    <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID" UniqueName="ID">
                    <telerik:GridTemplateColumn UniqueName="perComplete" HeaderText="Percent Complete"
                            <telerik:RadNumericTextBox ID="pct" runat="server" Text='<%#Eval("pct") %>' MinValue="0"
                                MaxValue="100" Width="50px">
                                <NumberFormat AllowRounding="true" DecimalDigits="4" />

    I hope this helps.

    Kind regards,
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top