0
我用下面的代码到一个ArrayList绑定到DataGridWPF的Datagrid刷新数据
//fill datagrid
public DataTable configData
{
get
{
DataSet dsTemp = new DataSet();
DataTable Tables = new DataTable();
dsTemp.Tables.Add(Tables);
dsTemp.Tables[0].Columns.Add("val", System.Type.GetType(
"System.String"));
foreach (string str in IMDB.ML.Class.Config.getReadPaths())
{
if (str != string.Empty)
{
DataRow myRow = dsTemp.Tables[0].NewRow();
myRow[0] = str;
dsTemp.Tables[0].Rows.Add(myRow);
}
}
return dsTemp.Tables[0];
}
}
不过,我需要能够刷新我的数据我想补充一些新的数据列表之后。
datagrid.Items.Refresh()不工作...
的感谢!
又见网格将更新:http://stackoverflow.com/questions/1751897/how-to-get-the-wpf- toolkit-datagrid-to-show-new-rows-when-bound-to-dataset – 2009-11-23 17:24:41
您是否正在从UI线程更新DataTable? – 2009-11-23 17:25:19