dyl 你好,请尝试以下代码,详细内容请参考帮助文档->GetDataRowFromModelRow 章节:
- DataTable dt = new DataTable("Testing");
- int i;
- dt.Columns.Add("Number");
- dt.Columns.Add("Letter");
- dt.Rows.Add(new Object[] { "1", "One" });
- dt.Rows.Add(new Object[] { "2", "Two" });
- FarPoint.Win.Spread.Model.DefaultSheetDataModel dataModel = new FarPoint.Win.Spread.Model.DefaultSheetDataModel(dt);
- fpSpread1.ActiveSheet.Models.Data = dataModel;
- this.fpSpread1.Sheets[0].AddUnboundRows(1, 3);
- i = dataModel.GetDataRowFromModelRow(4) ;
- listBox1.Items.Add(i.ToString());
复制代码 |