Author Topic: Save elements in a tree_view to be restored upon next invocation of Slick Edit  (Read 4270 times)

msCoder

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
I am developing a custom form which has a tree_view control in it. I would like to be able to save the tree_view elements when I quit SlickEdit and then be able to restore them the next time SlickEdit is started. Can anybody give me some guidance on how to do this?

Thanks,
Mark  ???

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2898
  • Hero Points: 153
Take a look at _TreeSaveDataXML and _TreeLoadDataXML.  I will try to put together a sample later today.

msCoder

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0
Thank you for the quick response. I have given it a try - copying what I found in svcurl.e (which uses that function).

Partially works. My tree_view contains 5 columns. The first three are check-box columns, and the last two are text-columns.
The effect I am getting is that only the last two text-columns are getting restored. The first three columns do NOT show me a check-box??

Will keep trying...

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2898
  • Hero Points: 153
It is possible it doesn't save and restores checkboxes, I will take a look at it later.  I may be able to add it.

msCoder

  • Junior Community Member
  • Posts: 8
  • Hero Points: 0

Thank you again for the help. By using the callback functionality of _TreeLoadDataXML() & _TreeSaveDataXML(), I was able to add XML attributes to each node in the XML file, saving the checkbox state. When my 'load' callback is called I fetch the attribute and then call _TreeSetCheckState()

Seems to do the trick.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2898
  • Hero Points: 153
That's great, I'm sorry I didn't think of that.