XamDataTree运行时将节点添加到树 [英] XamDataTree add node to tree when running time
问题描述
在我的应用程序中,我使用了XamDataTree并成功地显示了节点并添加了菜单.但是我没有什么问题,当我右键单击树上显示的菜单并单击菜单时,应该在XamDataTree中添加一个节点.
我的方法就是这样
m_DataUtil是为树提供的数据.加载树时
In my application I used XamDataTree and sucessfully managed to show nodes and add menu. but I got little problem is that I when I right click on the tree a menu displayed and click on the menu should add a node to the XamDataTree .
my method is like this
m_DataUtil is Data provide for the tree. when loading tree
m_XamDataTree.ItemsSource = m_DataUtil.Data;
单击菜单时
when click the menu
m_DataUtil.AddProduct(m_product);
m_XamDataTree.UpdateLayout();
m_product是树中显示的数据.
但是,UpdateLayout(),树未显示我想添加的节点.
互联网上没有太多有关XamDataTree的信息,并且文档不足(我认为).
任何人都可以尝试这样做并知道该怎么做?
m_product is data shown in the tree.
however the UpdateLayout() , the tree did not show the node I suppose to add.
there are not much information on the internet about XamDataTree and Documentation is not enough (I think).
could anyone tried that and know what to do ?
推荐答案
这是专有的第三方产品.是否 http://www.infragistics.com [
This is a proprietary third-party product. Does http://www.infragistics.com[^] support you? The are supposed to support the customers.
—SA
尝试了许多解决方案后,我发现该怎么办.看代码;
after tried many solution I find out what to do. look at the code;
m_DataUtil = null;
this.InitData();
m_XamDataTree.ItemsSource = m_DataUtil.Data;
m_XamDataTree.UpdateLayout();
将datasource类设置为null,重新加载数据并设置ItemsSource,然后更新UI.
这项工作奏效了,希望该解决方案能帮助寻求相同功能的人
set datasource class null, reload data and set ItemsSource ,then update UI.
this worked, hope this solution help someone who looking for same fucntionality
这篇关于XamDataTree运行时将节点添加到树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!