问题描述:不希望绑定整个表单,只针对表单中某一区域绑定。
问题解答:Spread 提供SpreadDataBindingAdapter方法用于绑定数据到特定单元格区域。
关键代码:
- FarPoint.Win.Spread.Data.SpreadDataBindingAdapter data = new FarPoint.Win.Spread.Data.SpreadDataBindingAdapter();
- data.DataSource = dt;
- data.Spread = fpSpread1;
- data.SheetName = "Sheet1";
- data.MapperInfo = new FarPoint.Win.Spread.Data.MapperInfo(3, 3, 3, 3);
- data.FillSpreadDataByDataSource(
复制代码
效果截图:
示例下载:点击下载 |