设置方法如下:
- //存取 tag 列表
- List<string> _tagList = new List<string>();
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- return;
-
- this.FpSpread1.Sheets[0].RowCount = 2;
- this.FpSpread1.Sheets[0].ColumnCount = 2;
- for (int i = 0; i < 2; i++)
- {
- for (int j = 0; j < 2; j++)
- {
- string tag="行" + i.ToString() + "列" + j.ToString();
- this.FpSpread1.Sheets[0].SetTag(i, j, tag);
- _tagList.Add(tag);
- }
- }
- //循环列表,取单元格
- foreach (var tag in _tagList)
- {
- this.FpSpread1.Sheets[0].GetCellFromTag(null,tag).Text = tag;
- }
- }
复制代码 |