获取电子表格中列的值

时间:2015-06-18 08:42:38

标签: devexpress spreadsheet

我正在使用devexpress,当我尝试使用以下代码获取电子表格单元格的值时:

  Workbook workbook = new Workbook();
  Column firstColumn_byName = columns["A"];

我收到以下错误

  

当前上下文中不存在名称列

1 个答案:

答案 0 :(得分:1)

您尚未定义columns

Workbook workbook = new Workbook();

// Access a collection of columns.
ColumnCollection columns = workbook.Worksheets[0].Columns;

// Access the first column by its unique name.
Column firstColumn_byName = columns["A"];

取自:devexpress documentation