Pergunta

I have TreeList that is displaying my business object hierarchy, all of its parts implementing IVirtualTreeListData. However, at some point I want to make changes: remove some data, maybe add some data or move a leaf to another containing node. I can make the changes to underlying business objects, but displayed tree is not affected.

I presume the reason lies in the fact TreeList walks down the hierarchy of IVirtualTreeListData once, (it corresponds to first time expansion of the nodes), and then just uses he data stored in nodes retrieved on the way. How, then, can change in data source be propagated into view?

Foi útil?

Solução

To enable automatical synchronization of the XtraTreeList nodes hierarchy with the underlying business objects, please implement an IBindingList interface for child objects collection which you provided as the VirtualTreeGetChildNodesInfo.Children property.
The simplest way to accomplish this task is to create a BindingList<YourBusinessObject>() instance within your BusinessObject to store all child object and assign it to the info.Children property within theIVirtualTreeListData.VirtualTreeGetChildNodes() method implementation. In this case, the TreeList will automatically refresh the corresponding node when a your object is changed or deleted.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top