Solved

Treeview in-place editing problem

Posted on 2004-08-18
3
730 Views
Last Modified: 2010-04-16
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
0
Comment
Question by:d32coder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
Tyrsis earned 500 total points
ID: 11835150
Hi there,

I just tried duplicating your problem and just couldn't.  I used a button to add a node via:

var
    TreeNode : TTreeNode;
begin
    TreeNode := TreeView1.Items.Add(nil, '');
    TreeNode.EditText;
end;

After that, the OnEditing gets hit, I entered random characters, and clicked off the window / another tree node, and my OnEdited event was hit.  Perhaps this is a bug in Delphi 6?  Do you have all the service packs installed?  The only time I didn't get an OnEdited event was when the Caption entered was the same as what it was before editing.  Perhaps you can post a small sample that doesn't work and maybe we can spot the problem?

Tyrsis
0
 

Author Comment

by:d32coder
ID: 11838213
Thanks for your help.    I'll review my OnEdited code a little better and see if I made an error in the way I stored the changes in my record.   I'll be back to this topic soon.

Don
0
 

Author Comment

by:d32coder
ID: 11840252
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
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
drawing animated level bar based on numbers 3 111
TServerSocket - file via sendbuf or Text via sendtext ? 1 76
CheckListBox usage 3 81
DBGrid or StringGrid ? 6 120
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question