[CLOSED] Wrong Data in Grid

  1. #1

    [CLOSED] Wrong Data in Grid

    Hi all

    I got a Problem while displaying in Number with 16 Decimals in the Grid !

    See my Example...

    The Number '9999999999999999' shows as '10000000000000000' in the Grid !?

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Grid9999.aspx.cs" Inherits="ExtNetForumTest.Grid9999" %>
    
    <!DOCTYPE html>
    
    
    
    <script runat="server">
      protected void Page_Load(object sender, EventArgs e)
      {
        if (!X.IsAjaxRequest)
        {
          GridPanel1.Store.Primary.DataSource = new object[]
                {
                    new object[] { 1111 },
                    new object[] { 9999999999999999 },
                    new object[] { 10000000000000000 }
                };
    
          GridPanel1.Store.Primary.DataBind();
        }
      }
    </script>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
      <title></title>
    </head>
    <body>
      <form id="form1" runat="server">
        <ext:ResourceManager runat="server" />
    
        <ext:GridPanel ID="GridPanel1" runat="server" DisableSelection="true" Width="600" Height="350">
          <Store>
            <ext:Store runat="server">
              <Model>
                <ext:Model runat="server">
                  <Fields>
                    <ext:ModelField Name="decimalCol" />
                  </Fields>
                </ext:Model>
              </Model>
            </ext:Store>
          </Store>
          <ColumnModel runat="server">
            <Columns>
    
              <ext:Column ID="colGrossMass" DataIndex="decimalCol" Text="Mass" Width="200" runat="server"  />
    
            </Columns>
          </ColumnModel>
          <View>
            <ext:GridView runat="server" StripeRows="true" />
          </View>
        </ext:GridPanel>
    
    
      </form>
    </body>
    </html>
    Any Idea ?

    Btw: We can't change the current Ext.Net Version (2.5.2.10682) at this Moment !

    Peter
    Last edited by Daniil; Feb 03, 2015 at 2:12 PM. Reason: [CLOSED]
  2. #2
    I did some test with other data

          GridPanel1.Store.Primary.DataSource = new object[]
                {
                    new object[] { 1111 },
                    new object[] { 19 },
                    new object[] { 20 },
                    new object[] { 9 },
                    new object[] { 10 },
                    new object[] { 99 },
                    new object[] { 100 },
                    new object[] { 9999999999999999 },
                    new object[] { 10000000000000000 },
                    new object[] { 99999999999999999 },
                    new object[] { 100000000000000000 }
      };

    Attached Thumbnails Click image for larger version. 

Name:	2015-01-28_12-55-56.png 
Views:	19 
Size:	4.2 KB 
ID:	19601  
  3. #3
    I did some more test...

    The Problem occurs with 16 digits and above



                    new object[] { 9, "9" },
                    new object[] { 99 , "99" },
                    new object[] { 999, "999" },
                    new object[] { 9999 , "9999" },
                    new object[] { 99999 , "99999" },
                    new object[] { 999999, "999999" },
                    new object[] { 9999999 , "9999999" },
                    new object[] { 99999999 , "99999999" },
                    new object[] { 999999999 , "999999999" },
                    new object[] { 9999999999 , "9999999999" },
                    new object[] { 99999999999 , "99999999999" },
                    new object[] { 999999999999 , "999999999999" },
                    new object[] { 9999999999999 , "9999999999999" },
                    new object[] { 99999999999999 , "99999999999999" },
                    new object[] { 999999999999999 , "999999999999999" },
                    new object[] { 9999999999999999 , "9999999999999999" },
                    new object[] { 99999999999999999 , "99999999999999999" },
                    new object[] { 999999999999999999 , "999999999999999999" }
    I will use the String representation of the number as a temporary fix !
    Attached Thumbnails Click image for larger version. 

Name:	2015-01-28_12-55-56.png 
Views:	17 
Size:	11.7 KB 
ID:	19631  
  4. #4
    Hi

    Maximum integer value in javascript is 9007199254740992
    Please use double for big values or convert to string

    http://ecma262-5.com/ELS5_HTML.htm#Section_8.5
    http://stackoverflow.com/questions/3...-without-losin

Similar Threads

  1. Replies: 13
    Last Post: Sep 26, 2013, 10:04 AM
  2. [FIXED] [2.3] Sort wrong on Grid
    By Paul in forum Bugs
    Replies: 1
    Last Post: Aug 15, 2013, 3:05 PM
  3. Replies: 0
    Last Post: May 16, 2013, 6:46 AM
  4. Replies: 4
    Last Post: Oct 25, 2012, 2:02 PM
  5. Retieving Data from data base in the Grid Panel
    By Rakeshkumar.a in forum 1.x Help
    Replies: 0
    Last Post: Oct 13, 2010, 6:18 AM

Posting Permissions