回复 3楼p332718873的帖子
p332718873 你好,
可以在首次加载时,保存 Spread 为 Stream,需要重置时加载:
- System.IO.MemoryStream stream;
- public MainPage()
- {
- InitializeComponent();
- gcSpreadSheet1.Sheets[0].Cells[0, 0, 2, 2].Text = "Test";
- gcSpreadSheet1.Invalidate();
- stream = new System.IO.MemoryStream();
- gcSpreadSheet1.SaveXml(stream);
- gcSpreadSheet1.Invalidate();
- gcSpreadSheet1.Sheets[0].Cells[5,5].Text = "Test";
- }
- private void button1_Click(object sender, RoutedEventArgs e)
- {
- stream.Seek(0, SeekOrigin.Begin);
- gcSpreadSheet1.OpenXml(stream);
- gcSpreadSheet1.Invalidate();
- }
复制代码 |