使用 Aspose.Cells.GridDesktop 读取 Excel 文件中的数据验证

使用 Aspose.Cells.GridDesktop 读取 Excel 文件中的数据验证

以下示例代码导入示例 excel 文件其中包含一些数据验证在 GridDesktop 里面。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Import sample excel file in GridDesktop
gridDesktop1.ImportExcelFile(dataDir + "ValidationTesting.xlsx");

将文件导入 GridDesktop 后,当我们尝试将单元格 A2 的值更改为大于 100 时弹出验证错误消息框.