Clicking a table cell causes OnItemAction to fire
Clicking a table cell causes OnItemAction to fire
I noticed that OnItemAction fires with ItemAction = rviaInserting when clicking inside a cell if caret was previously outside.
I figure this happens because of the trick with a nested inplace editor, which comes transparently to life when a cell is being edited. However, for all practical purposes this is a false event. It shouldn't fire if insertion is a result of an internal inplace editor creation.
Can it be fixed? If not, what can I do to detect when OnItemAction is being triggered by a valid change in the editor and when it's a false alarm?
I figure this happens because of the trick with a nested inplace editor, which comes transparently to life when a cell is being edited. However, for all practical purposes this is a false event. It shouldn't fire if insertion is a result of an internal inplace editor creation.
Can it be fixed? If not, what can I do to detect when OnItemAction is being triggered by a valid change in the editor and when it's a false alarm?
After digging through the source, I found a way to detect the situation. In OnItemAction I check Sender.Focused value. If it's False, then the event is a result of inplace editor being filled with cell contents. If it's True, then it's a genuine event.
The question remains if this check will still work with the next RV version. Is this likely to change, Sergey?
The question remains if this check will still work with the next RV version. Is this likely to change, Sergey?
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Calling this event in this case is by design - items are informed that their parent RVData is changed (cell -(editing)-> inplaceeditor and back).
I am not sure about the Focused property, may be it is False by accident.
How do you use this event? If you maintain a list of inserted items (of some type), you can check if they were already inserted.
I am not sure about the Focused property, may be it is False by accident.
How do you use this event? If you maintain a list of inserted items (of some type), you can check if they were already inserted.
Dear Sergey,
I found the same problem when a picture is nested in a table the rviaInserted is used while the picture isn't inserted by the user.
I use the following sourceparts:
Could you please advise me what to do?
Thanks.
I found the same problem when a picture is nested in a table the rviaInserted is used while the picture isn't inserted by the user.
I use the following sourceparts:
Code: Select all
rve->RVFOptions = rve->RVFOptions >> rvfoSavePicturesBody >> rvfoSaveBack;
ONRVFPictureNeeded event for loading images from the harddisc and internet.
And the rviaInserted in the OnItemAction for saving some picture properties to a file.
Thanks.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: