TreeView State

Discussion in 'Questions (Windows Mobile)' started by marathon332, Jun 16, 2009.

  1. marathon332

    marathon332 Member Licensed User


    I'm using the treeview from ControlsEx as a folder and file explorer and I want to save the last selected node in an ini so that I can reload it on startup. I want to save the state of the treeview and recall it later....

    Does anyone have a code or method of doing this?

  2. Erel

    Erel Administrator Staff Member Licensed User

  3. marathon332

    marathon332 Member Licensed User

    Thanks Erel...

    I looked at that particular post before I asked the question. In looking at the code, I did not see the specific method of saving and loading of the treeview. I can't spot it in the code probably because I haven't used the control before this...Unfortunately, the authors are better at coding than they are at commenting.

    Are there some code snippets that I should be paying attention to? If so, can you quote them?
  4. specci48

    specci48 Well-Known Member Licensed User

    To be honest, I'm not really sure about this... :sign0137:

    The ToDoTree application was not intended as a sample program, so I agree that it lacks (a litlle bit) of commenting. :sign0013:

    Since there is no build-in function to save and load a treeview (state) I had to find my own way of doing it. Additionally "my" ToDoTree handles with some more information that had to be stored and reloaded, not only the treeview state. Because of this there is no "global" code snipplet that can be used in other applications by copy and paste. :(

    As far as I can see if you want to save and load a treeview you need
    a) to know, how to cycle through a treeview (in a recursive way)
    b) to save the depth of every node beside the text of it

    If you still need some help and you don't need an answer in the next few days I'll provide a small sample program within the next week (because I'm very busy at the moment...)

  5. marathon332

    marathon332 Member Licensed User


    I appreciate your response... I think your Todo program is great.

    I guess I'm just a little frustrated with the fact that I can't resolve the issue in a non-complicated way. This forum has been very helpful in the past, so maybe I'm a little spoiled...

    The treeview state is a small aspect of my program but I think it's important for usability, so I appreciate any help I can get on this...

    Once we have it figured out, I'll make sure to share the code here so that others won't have the same problem in the future...

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice