回复 3楼yimi020103的帖子
很抱歉回复晚了。
Spread 提供了CellRange的数据绑定方法,可以将spread上的一片区域绑定到额外的数据源,它使用的是SpreadDatabindingAdpater类型创建连接,使用MapperInfo对应cellrange和数据源。
代码参考,绑定spread的一个区域到数据源"dt"
- //C#
- FarPoint.Win.Spread.Data.SpreadDataBindingAdapter data = new FarPoint.Win.Spread.Data.SpreadDataBindingAdapter();
- // Assign the datasource to a data table
- data.DataSource = dt;
- data.Spread = fpSpread1;
- data.SheetName = "Sheet1";
- data.MapperInfo = new FarPoint.Win.Spread.Data.MapperInfo(3, 2, 1, 1);
- data.FillSpreadDataByDataSource();
复制代码
产品文档参考: Spread Windows Forms 8.0 Product Documentation > Developer's Guide > Managing Data Binding > Binding to Data > Binding a Cell Range in Spread to an External Data Source |