请问通过区域数据绑定方式设置数据源后,保存文件再打开还能获取DataTable吗??
请问通过区域数据绑定方式设置数据源后,保存为XML文件,再打开还能获取设置的DataSource的DataTable吗?例如: private void 区域绑定ToolStripMenuItem_Click(object sender, EventArgs e)
{
dt = new DataTable();
dt.Columns.Add("第一列");
dt.Columns.Add("第二列");
dt.Columns.Add("第三列");
dt.Rows.Add("a", "b", "c");
dt.Rows.Add("1", "2", "3");
dt.Rows.Add("zz", "bb", "dd");
this.fpSpread1.Sheets.Reset();
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, dt.Rows.Count, dt.Columns.Count);
data.FillSpreadDataByDataSource();
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
fpSpread1.Save(CertifPath.ToString(), false);
}
private void opebToolStripMenuItem_Click(object sender, EventArgs e)
{
string CertifPath = AppDomain.CurrentDomain.BaseDirectory + "11.xml";
fpSpread1.Open(CertifPath);
}
例如执行opebToolStripMenuItem_Click打开文件后,如何获取先前的dt ?
没有办法获取的,保存的文件中并不包含这些信息
页:
[1]