Page 1 of 1

Load From Stream Not Saving to Dataset

Posted: Mon Oct 15, 2007 9:09 pm
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,

Posted: Tue Oct 16, 2007 8:30 am
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.

Posted: Tue Oct 16, 2007 10:54 am
by btucker21
Worked correctly.
Thanks for the prompt and helpful response.