Load From Stream Not Saving to Dataset

General TRichView support forum. Please post your questions here
Post Reply
btucker21
Posts: 3
Joined: Mon Oct 15, 2007 9:01 pm

Load From Stream Not Saving to Dataset

Post by btucker21 »

I am copying the contents from a TRichViewEdit to a TDBRichViewEdit using the following code. The contents copies perfectly. However, when I post the record linked to the TDBRichViewEdit, the contents reverts back to what it was before the edit. It seems to me that the record buffer is not getting notified that it has changed. If I manually make a slight change to the contents after it I saved in the TDBRichViewEdit, then the record posts correctly. Any thoughts?

vContents :=TMemoryStream.Create;
RichViewEdit1.SaveRVFToStream(vContents, False);
if vContents.Size<1 then
TempMemo.Clear
else
begin
TempMemo.Clear;
TempMemo.DeleteUnusedStyles(True, True, True);
TempMemo.Format;
vContents.Position :=0;
TempMemo.LoadRVFFromStream(vContents);
TempMemo.Format;
TempMemo.ScrollTo(0);
End;

Thanks,
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Change LoadRVFFromStream to InsertRVFFromStreamEd.
Additional information can be found in the help file, example 1 ("Using viewer-style methods in DBRichViewEdit") in the topic about TDBRichViewEdit.
btucker21
Posts: 3
Joined: Mon Oct 15, 2007 9:01 pm

Post by btucker21 »

Worked correctly.
Thanks for the prompt and helpful response.
Post Reply