在配置文件中用于样式化列标头的数据不存在或已经丢失
这样的问题如何解决?
所涉及代码如下:
private void Formtest_Load(object sender, System.EventArgs e)
{
this.lvTest .SchemaFileName = Config.PathConfig +"FAMS.xml";
this.lvTest .InitializeColumnHeaders("TableName='f_test'");
this.lvTest .ID="id";
DataOther m_Data = new DataOther (Config.CntString );
DataTable dtOther = m_Data.TExecSQLTableDirect("SELECT * FROM f_other");
this.lvTest .FillData (dtOther);
}
private void button1_Click(object sender, System.EventArgs e)
{
DataOther m_Data = new DataOther (Config.CntString );
DataTable dtOther = m_Data.TExecSQLTableDirect("SELECT * FROM f_other where id >10");
this.lvTest .FillData (dtOther);
}
配置文件:
<?xml version="1.0" encoding="utf-8" ?>
<View TableName="f_test">
<Column Text="类别" ColumnName="Sort" SeachName="" Width="150" Type="4" Query="1" />
<Column Text="金额" ColumnName="Money" SeachName="" Width="100" Type="2" Query="1" />
<Column Text="经手人" ColumnName="Name" SeachName="" Width="130" Type="4" Query="1" />
<Column Text="时间" ColumnName="DateTime" SeachName="" Width="160" Type="8" Query="1" />
<Column Text="备注" ColumnName="Remark" SeachName="" Width="160" Type="4" Query="1" />
</View>
</Views>