我正在尝试更新一个Devexpress TreeList的ItemSource。它似乎在我第一次按下按钮时就能工作了,但是它不再起作用了……还有什么东西我必须更新才能改变ItemSource。
码
window.randButton.Click += delegate
{
string st = window.nList.CurrentCellValue.ToString();
System.Diagnostics.Debug.WriteLine("Called: "+st);
try {
window.treeList.ItemsSource = null;
window.treeList.ItemsSource = drawOrderBook(currCycle, st);
// currCylce is static data
// drawOrderBook computes what to display based on the filer st
}
catch(Exception er) { System.Diagnostics.Debug.WriteLine(er.ToString()); }
};发布于 2015-09-07 04:07:18
我对DevExpress网格也有类似的问题。
根据他们的指导方针/技术支持,当数据排序被修改/更改时,您必须调用RefreshDataSource方法。
所以你的代码应该是这样的。
window.randButton.Click += delegate
{
string st = window.nList.CurrentCellValue.ToString();
System.Diagnostics.Debug.WriteLine("Called: "+st);
try
{
window.treeList.ItemsSource = null;
window.treeList.ItemsSource = drawOrderBook(currCycle, st);
window.treeList.RefreshDataSource();
// currCylce is static data
// drawOrderBook computes what to display based on the filer st
}
catch(Exception er) { System.Diagnostics.Debug.WriteLine(er.ToString()); }
};https://stackoverflow.com/questions/32430675
复制相似问题