If I try
ListView1.items[0].EditCaption;
it works as expected allowing me to edit the first items caption, however if while editing I try
ListView1.items[0].CancelEdit;
It does not cancel the editing. Is there some concept I’m missing, is it a bug, or is the help wrong?
This seems to be a problem in Delphi 2007 and XE2 (and probably others).
I think this is a problem with the native control, the VCL does as documented (calls
ListView_EditLabel(Handle, -1);), but to no effect. According to the documentation ofListView_GetEditControl, sending the list view aWM_CANCELMODEshould also work, which it doesn’t.A test here shows the below works,
interestingly
ListView1.SetFocusdoesn’t.