我有两个依赖表..需要通过使用c#.Made Drop Down Cell添加验证来在Excel单元格中创建依赖ddl,但请根据Provider Cell值帮助生成Product Cell级联或依赖单元格。
worksheet.DataValidations.Add(new DataValidation(worksheet.Cells.GetSubrange("L" + i.ToString(), "L" + i.ToString()))
{
Type = DataValidationType.List,
Operator = DataValidationOperator.Between,
Formula1 = RangeProviders,
InputMessageTitle = "Provider",
InputMessage = "Please select a Provider",
ErrorTitle = "Invalid Provider",
ErrorMessage = "Provider must be one from the list."
});
worksheet.DataValidations.Add(new DataValidation(worksheet.Cells.GetSubrange("M" + i.ToString(), "M" + i.ToString()))
{
Type = DataValidationType.List,
Operator = DataValidationOperator.Between,
Formula1 = RangeProducts,
InputMessageTitle = "Product",
InputMessage = "Please select a Product",
ErrorTitle = "Invalid Product",
ErrorMessage = "Product must be one from the list."
});