使用Aspose.Cells.GridDesktop在Excel文件中读取数据验证
Contents
[
Hide
]
Aspose.Cells.GridDesktop可以读取和应用Excel文件中的数据验证。请在GridDesktop中加载您的Excel文件,其中的所有数据验证将开始像在Microsoft Excel中一样工作。
在Excel文件中读取Aspose.Cells.GridDesktop中的数据验证
以下示例代码导入了包含GridDesktop中一些数据验证的示例Excel文件。
This file contains 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时,会弹出验证错误消息框。