使用 Aspose.Cells.GridDesktop 读取 Excel 文件中的数据验证
Contents
[
Hide
]
Aspose.Cells.GridDesktop可以读取和应用数据验证在您的 Excel 文件中。请在 GridDesktop 中加载您的 Excel 文件,其中的所有数据验证将像在 Microsoft Excel 中一样开始工作。
使用 Aspose.Cells.GridDesktop 读取 Excel 文件中的数据验证
以下示例代码导入示例 excel 文件其中包含一些数据验证在 GridDesktop 里面。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 时弹出验证错误消息框.