Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
There are some load options we can set before importing the file.
We can use GridLoadOptions (for general files) and GridTxtLoadOptions (for CSV files).
For a CSV file, it is actually a text‑based file without the specific encoding described in the XLSX format.
Therefore, users can set a specific character encoding before loading the file.
Here is a sample code to load a Chinese CSV file:
GridTxtLoadOptions topt = new GridTxtLoadOptions();
topt.Encoding = Encoding.GetEncoding("GB2312");
GridWeb1.LoadOptions = topt;
string filePath = Server.MapPath("~/workbook/chinesefile.csv");
GridWeb1.ImportExcelFile(filePath);
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.