Posted 11 November 2019, 2:05 am EST
Is there a way to set the DataType of a Cell or a Column? I don’t mean the String Format as in “sheet.Columns(x).Style.Format”. I think of something like “sheet.Columns(x).DataType”.
Forums Home / ComponentOne / WinForms Edition
Posted by: michael.chojetzki on 11 November 2019, 2:05 am EST
Posted 11 November 2019, 2:05 am EST
Is there a way to set the DataType of a Cell or a Column? I don’t mean the String Format as in “sheet.Columns(x).Style.Format”. I think of something like “sheet.Columns(x).DataType”.
Posted 12 November 2019, 6:08 pm EST
Hello,
C1Excel is designed to provide the same functionality as Microsoft Excel.
As columns in MS Excel does not have any DataType property (it has Format Cells option) so DataType property is not available for C1Excel’s Columns.
You can check out our Spread control which is also similar to MS Excel and provide you the functionality to set the datatype of the column as given in the link below :
Regards,
Prabhat Sharma.
Posted 12 November 2019, 7:09 pm EST - Updated 3 October 2022, 3:32 pm EST
Hello,
which format do I have to add to the cell so that the hint from Excel disappears:
The Hint says: “Number stored as text”
Posted 13 November 2019, 3:54 pm EST
Posted 13 November 2019, 6:07 pm EST
Hello,
You can use the Spread for Winform to achieve your requirements. In Spread, You can assign the CellType(Like Number) to the cell, which is saved as Number type cell in exported excel file. Please refer to the following documentation and the attached sample.
https://www.grapecity.com/spreadnet/docs/v13/online-win/spwin-setcelltypes.html
https://www.grapecity.com/spreadnet
Hope it helps.
Thanks,
Mohit