Int32 vs String

Posted by: sgmicro on 8 September 2017, 2:36 pm EST

  • Posted 8 September 2017, 2:36 pm EST

    <p>Hello,</p><p>I use a Dataset with 5 columns. One of this columns set to  Int32 type. I make   "grid.DataSource = MyDataSet" to fill my grid. I' haven' formatted my grid then all my columns are default type. <br>Pb : when my Int32 field set to "1234" it's ok by if i put "12345678" the value isn't visible on the grid.<br>If i set type to NumberCellType for this column it's OK "12345678" is visible.<br>How it doesn't work for default column   type ?<br>I try that on 2 computer (same spread version) and it's the same thing)</p><p>thks</p><p>DT </p>
  • Replied 8 September 2017, 2:36 pm EST

    <P>When you import Data from a Dataset Spread sets the celltype based on the data in the dataSet if you have SheetView.DataAutoCellTypes = True, which it is by default,, other wise the default celltype is the GeneralCellType and it has a NumberFormat property that takes a NumberFormatInfo Object which has a property NumberDecimalDigits which you can set to display your large numbers.</P>
  • Replied 8 September 2017, 2:36 pm EST

    <P>I am not am able to reproduce the issue you describe.  In my testing, I using code like the following and everything worked fine.</P>
    <P>    DataTable dataTable = new DataTable();<BR>    dataTable.Columns.Add("A", typeof(System.String));<BR>    dataTable.Columns.Add("B", typeof(System.Int32));<BR>    dataTable.Rows.Add(new object[] {"one", 1234});<BR>    dataTable.Rows.Add(new object[] {"two", 12345678});</P>
    <P>    DataSet dataSet = new DataSet();<BR>    dataSet.Tables.Add(dataTable);</P>
    <P>    fpSpread1.Sheets[0].DataSource = dataSet;</P>
    <P>Could you provide a sample that demostrates the issue?  Or could you provide a code to reproduce the issue?</P>
  • Replied 8 September 2017, 2:36 pm EST

    <p>here an example</p><p>thks </p>
  • Replied 8 September 2017, 2:36 pm EST

    <p>Hello,</p><p>The version of Spread you are using is the older version of Spread and I am unable to replicate the same with the latest version of Spread 4.0. Please have a look at the screenshot for the same and I would request you to upgrade your application to the latest build available which is 4.0.xx26.2008. You can get the latest build from this link.<br></p><p>Thanks. <br></p>

  • Replied 8 September 2017, 2:36 pm EST

    <p>it's ok with latest version of spread V4</p><p>thanks</p><p> </p>
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels