仅供参考。
if (ret == DialogResult.OK) //更新按钮点击ok的情况下
{
fpSpread1.ActiveSheet.Models.ResetViewRowIndexes();
var copyBase = this.EditTarget.AfterEditModel;
foreach (var (item, colIdx) in ColumnDefs.Select((item, colIdx) => (item, colIdx)))
{
var property = typeof(Model.数据源).GetProperty(item.Key);
fpSpread1.ActiveSheet.Cells[rowIdx, ColumnIdx(item.Key)].Value = property.GetValue(copyBase);
}
} |