How do I activate an in-place editor for a grid cell that displays as a progress bar?
Asked Answered
E

1

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.

Elianaelianora answered 6/9, 2012 at 14:41 Comment(2)
Please clarify the component DBTreeListView, is it standard TTreeView or it is some 3rd party component?Chorus
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.Roach
L
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

Lira answered 3/6, 2014 at 4:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.