- fpSpread.Sheets[0].SheetName = "T1";
- List<MyClass> strList = new List<MyClass>();
- 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 = fpSpread;
- data.SheetName = "T1";
- data.MapperInfo = new FarPoint.Win.Spread.Data.MapperInfo(15,3, strList.Count, 1);
- data.FillSpreadDataByDataSource();
- data.Dispose();
- //锁定一列
- fpSpread.Sheets[0].Protect = true;
- fpSpread.Sheets[0].Columns[3].Locked = true;
复制代码
锁定不了“111”,“222”,“333”,“444”所在行,不知道是不是绑定的数据源,这么锁定不对? |