rvico TRichView Reference | Item Types | Table

TRVTableItemInfo.Changed

Top  Previous  Next

"Informs" table about updates in its content.

procedure Changed;

After performing operations on table which was already inserted in document you should reformat this document.

It is usually done by BeginItemModify/EndItemModify (if the table was inserted in TRichViewEdit) or Format (if the table was inserted in TRichView).

But you can realize that in some cases table will not be updated even after formatting. This happens because the table does not "know" about changes in it, so it reuses the previous formatting.

The most of operations on table (including all methods of TRVTableItemInfo, and editing operations in cell inplace-editor) "inform" table about changes in its content and thus allowing subsequent reformatting. But viewer-style operations performed on cells do not "inform" table, and their result cannot be shown after reformatting. You can inform table about changes in its content by this method.

Example

table := TRVTableItemInfo(MyRichView.GetItem(ItemNo));

table.Cells[0,0].Clear;

table.Cells[0,0].AddNL('One more line',0,0);

table.Changed;

MyRichView.Format;

Note: since version 1.7, it's not required to call table.Changed before Format. But it is still useful when using BeginItemModify/EndItemModify.


TRichView © trichview.com