回复 1楼liu.bobo的帖子
你好,不好意思,让你久等了。
1.需要在代码中添加 Spread SaveChanges 方法,保存更改状态:
- /// <summary>
- /// 全て表示
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected void AllDispButton_Click(object sender, EventArgs e)
- {
- //this.DispMethod();
- SheetView sheet = this.ItemSpread.ActiveSheetView;
- sheet.RowCount = 10;
- for (int i = 0; i < 10; i++)
- {
- sheet.Cells[i, 2].Value = 1;
- }
- this.ItemSpread.SaveChanges();
- }
- /// <summary>
- /// 全て非表示
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected void AllUnDispButton_Click(object sender, EventArgs e)
- {
- //this.DispMethod();
- SheetView sheet = this.ItemSpread.ActiveSheetView;
- sheet.RowCount = 10;
- for (int i = 0; i < 10; i++)
- {
- sheet.Cells[i, 2].Value = 2;
- }
- this.ItemSpread.SaveChanges();
- }
复制代码
2.至于每行的选中状态可以通过该 Cell[i,j].Value 来取。 |