Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
270
Recursive binding
posted

Well, another trouble with WinTree binding.

I have an entity Directory. It has properties DirectoryID and ParentDirectoryID. Also it has property SubDirectories, of type List<Directory>, which return all directories that belong to this one on a criteria dir.[ParentDirectoryID]==this.[DirectoryID].

So I have List<Directory> _repositoryDirectories, that I wanna show in a tree in hierarchical view.

From this point  the problems begin to rise.

1. I create columnsetgenerated handler and it fires twice - first immediatly after the binding, second - after I expand any of the first-level directories (root directories). The first one fires with columnset key == "", second - with columnset key == "SubDirectories". Both get processed correctly and I can see the structure of tree with first and second level nodes displayed properly. BUT! When I expand any of the second level directory to get third level - nothing happens. No event is  fired, and I don't see the nodes (but I assured that there ARE directories in the third level). Recursion fails - dunno why. I get two levels only.

2. I checked out your example about recursive binding. It's ok, but it works only upon dataset and datarelation and I utterly hate both of them as being very unsuitable (IMHO) for full-powered ORM.

So I want to ask u to help me to make it work upon object BindingList or any sort of bindable collection - which I tend to use in my applications.

I merely wanna get a recursive binding with all of my nodes showing properly.

THANKS IN ADVANCE!

  • 469350
    Suggested Answer
    Offline posted

    Hi,

    It makse sense that ColumnSetGenerated does not fire for the third level, because if the data is recursive, then the third level will be using the same ColumnSet as the second level.

    Why the data is not showing up is puzzling, though. Can you duplicate this in a small sample project and post it here?