GridWeb 的加载选项

加载其他编码

对于csv文件,其实是一个文本文件,没有xlsx格式文件中描述的具体编码。

因此,用户可以在加载文件之前设置特定的字符编码。

这是一个用中文加载的示例代码:

    GridTxtLoadOptions topt = new GridTxtLoadOptions();
    topt.Encoding = (Encoding.GetEncoding("GB2312"));
    GridWeb1.LoadOptions = topt;
    String filePath = Server.MapPath("~/workbook/chinesefile.csv");
    GridWeb1.ImportExcelFile(filePath);