我正在尝试根据单元格选择(值)为整行着色。我想仅更改工作表中使用的范围的行颜色,但不更改未使用的单元格的颜色。
这是我现在的代码:
class Program
{
static void Main(string[] args)
{
CreateWorkbook();
}
static void CreateWorkbook()
{
var workbook = new XLWorkbook();
var ws1 = workbook.AddWorksheet("Main");
var ws2 = workbook.AddWorksheet("ListOfOptions");
var listOfStrings = new List<String>();
listOfStrings.Add(" ");
listOfStrings.Add("Edit");
listOfStrings.Add("Delete");
ws2.Cell(2,2).InsertData(listOfStrings);
workbook.Worksheet(1).Column(3).SetDataValidation().List(ws2.Range("B2:B4"), true);
var list = new List<Person>();
list.Add(new Person() { Name = "John", Age = 30, Action = " " });
list.Add(new Person() { Name = "Mary", Age = 15, Action = " " });
list.Add(new Person() { Name = "Luis", …Run Code Online (Sandbox Code Playgroud)