10

One of the cells in my DBTreeListView is bound to a repository item that is a progress bar.

I want to be able to edit the progress displayed by clicking on this cell. At this stage my application should change its cell to another repository item: a text field where I'll be able to insert a value. Once focus is changed to another cell, my progress bar should be displayed again, showing a new value. How do I do this?

DBTreeListView has column events OnGetEditingProperty and OnGetEditProperties. I'll probably use one (or both) of them, but can't come up with any good idea.

Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467
svsiko
  • 111
  • 5
  • 2
    Please clarify the component DBTreeListView, is it standard TTreeView or it is some 3rd party component? – Flanker Jan 29 '14 at 20:51
  • Voting to close, because the control TDBTreeListView does not exist (according to both Google and Bing). DBTreeView does exist as an child of Virtual TreeView. – Johan May 15 '14 at 09:41

1 Answers1

0

This can be simply. You should handle click on this progress bar and display editor over it. You need to handle scrolling and clicking in another place to get rid of editor. And in case that scrolling too far - editor should be hidden.

Steps:

  1. Create hidden editor for progress
  2. Handle OnClick for tree view item
  3. Display editor and set focus
  4. On editor enter (or tab) save progress information
  5. On click on form or another part of tree view - hide editor (saving/discarding changes how specified by your policy)
  6. On scroll tree view move the editor and when bounds of parent does not overlap bounds of editor - hide it

Best regards, Vladimir

YanetP1988
  • 1,346
  • 3
  • 18
  • 43
stoarch
  • 44
  • 4