RadSpreadSheet CSV Import Field Types

0 Answers 168 Views
Spreadsheet
Todd
Top achievements
Rank 1
Todd asked on 14 Apr 2022, 05:46 PM
When importing a CSV file (or any file for that matter) how can I make every field a Text field rather than the import process trying to determine the data type and setting it. This is specifically causing me issues when importing fields with values like 9/10 which aren't dates.
Svilen
Telerik team
commented on 18 Apr 2022, 10:15 AM

Hey, Todd,

Svilen here, I will be glad to help out with this question. Since I already shared the same answer in your ticket, I am sharing it here too as it could be helpful to others.

The library's CsvFormatProvider, does not support selecting a specific cell value format when importing a .csv file. We have a feature request for its implementation, which is represented by this public feedback item - SpreadProcessing: Implement an option to import numbers as text from CSV. The title describes a slightly different scenario since it is a subcase of the feature, which requires the same underlying functionality.
You can track its progress, subscribe to status changes, and add your comment to it using the link. Upon completion of the task, we will notify all subscribers of the public feedback item of the news.

Until the feature is implemented, I can suggest a general workaround, which includes extracting the cell values using a third-party (or custom) CSV parser and inserting them manually into the worksheet, using the CellSelection.SetValueAsText method (described in our Cell Value Types article).

No answers yet. Maybe you can help?

Tags
Spreadsheet
Asked by
Todd
Top achievements
Rank 1
Share this question
or