回复 1楼xiaoding的帖子
通过以下代码我没有重现这个问题:
- List<MyClass> strList = new List<MyClass>();
- private void Form1_Load(object sender, EventArgs e)
- {
- fpSpread1.Sheets[0].SheetName = "T1";
- strList.Add(new MyClass() { P1 = "111" });
- strList.Add(new MyClass() { P1 = "222" });
- strList.Add(new MyClass() { P1 = "333" });
- strList.Add(new MyClass() { P1 = "444" });
- FarPoint.Win.Spread.Data.SpreadDataBindingAdapter data = new FarPoint.Win.Spread.Data.SpreadDataBindingAdapter();
- data.DataSource = strList;
- data.Spread = fpSpread1;
- data.SheetName = "T1";
- data.MapperInfo = new FarPoint.Win.Spread.Data.MapperInfo(0, 0, strList.Count, 1);
- data.FillSpreadDataByDataSource();
- data.Dispose();
- }
- private class MyClass
- {
- public string P1 { get; set; }
- }
- private void clearDataToolStripMenuItem_Click(object sender, EventArgs e)
- {
- fpSpread1.Sheets[0].ClearRange(0, 0, strList.Count, 1, true);
- }
复制代码
能否发个重现问题的 Demo 到论坛调试? |