d32coder
asked on
Treeview in-place editing problem
Delphi 6
Win XP Home
I have a Treeview and a series of Toolbuttons.
User clicks the "Add Toolbutton". This creates a new TreeNode and sets it to Node.EditText;
The user enters random text and presses enter. The label data is processed by the TV.OnEdited event.
So far so good.
If the user changes the node's label but does not hit ENTER, but instead clicks another node or another control, the TV.OnEdited event doesn't seem to get called. I tried to set the OnChanging event to say
If (Tv.IsEditing) then
TV.Selected.EndEdit(FALSE) ;
but the data is still not saved. The label itself is changed but I have to commit the changes to a record as well and that occurs in the OnEdited event. Any ideas?
Don
Win XP Home
I have a Treeview and a series of Toolbuttons.
User clicks the "Add Toolbutton". This creates a new TreeNode and sets it to Node.EditText;
The user enters random text and presses enter. The label data is processed by the TV.OnEdited event.
So far so good.
If the user changes the node's label but does not hit ENTER, but instead clicks another node or another control, the TV.OnEdited event doesn't seem to get called. I tried to set the OnChanging event to say
If (Tv.IsEditing) then
TV.Selected.EndEdit(FALSE)
but the data is still not saved. The label itself is changed but I have to commit the changes to a record as well and that occurs in the OnEdited event. Any ideas?
Don
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Well, Placed a ShowMessage at the top of my OnEdited event and it does indeed fire. My problem is in my data storage routine, not in the component. Points awarded for the time you spent trying to reproduce the error.
Don
Don
ASKER
Don