I want to insert items from a dbgrid into the text, I will use drag and drop, so far so good, I know how to do. The problem is that when using a data from a dbgrid I need to change the color of the line and in case the user deletes the dragged text, dbgrid needs to return the line to normal.
I thought of leaving a comment within the text dragged in rich text using {\ * \ annotdef ...} - it would contain a reference to the database field that I would read to update the gride and - if the user deletes the inserted text, the comment would be erased together - also allowing you to update the gride, but to make it right I would have to drag the text into the code at the rich text level, and I only saw the inserttext method that I do not think inserts at that text level.
Inserttext into rich text
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Inserttext into rich text
The current version of TRichView does not support annotdef RTF code.
If you need to insert a field, you can use InsertStringTag. Encode some information in tag string, allowing to identify the grid cell.
See the example: Demos\DelphiUnicode\Assorted\Fields\LiveLink\Tables\
If you need to insert a field, you can use InsertStringTag. Encode some information in tag string, allowing to identify the grid cell.
See the example: Demos\DelphiUnicode\Assorted\Fields\LiveLink\Tables\
Re: Inserttext into rich text
right, but when I insert fields in this way I can not export to rtf and then reopen and have access to the ids of those fields?
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Inserttext into rich text
Unfortunately, RTF annotations and merge fields are not supported yet, so you can save all additional information only in RVF files.