rvico TRichView Reference | Item Types | Table | Cell


Top  Previous  Next

Returns object containing cell data (document items)

function GetRVData: TCustomRVData;

The cell is "an object containing data" itself. But when cell is in editing state, all its data are moved to inplace editor, and the cell is empty.

This method returns:

the cell itself, if it is not in editing state;

RVData property of inplace editor, otherwise.

So when working with content of cell directly, you can use this method and do not worry about editing state of a cell.

Example (retrieving text from table):

function GetTableText(table: TRVTableItemInfo): String;


  i, r, c: Integer;

  RVData: TCustomRVData;


  Result := '';

  for r := 0 to table.RowCount-1 do


    for c := 0 to table.ColCount-1 do

      if table.Cells[r,c]<>nil then


        RVData := table.Cells[r,c].GetRVData;

        for i := 0 to RVData.ItemCount-1 do


          if (i>0and RVData.IsFromNewLine(i) then

            Result := Result + #13#10;

          if RVData.GetItemStyle(i)=rvsTab then

            Result := Result + #9

           else if RVData.GetItemStyle(i)>=0 then

            Result := Result + RVData.GetItemText(i);


        Result := Result + table.TextColSeparator;


    Result := Result + table.TextRowSeparator;



See also methods:


TRichView © trichview.com