This is ready. Now I need to select certain text in a certain cell, for example, from 10th to 20th characters in the cell[3, 1]. I guess I should use SetSelectionBounds function. But what parameters do I have to pass into it in my case?
Code: Select all
procedure AddRow(List: TTntStringList; index, ParaStyleId, TextStyleId: Integer);
var
tmp: WideString;
begin
if List.Count > index then
tmp := List[index]
else
tmp := '';
if RowCount > TableInfo.RowCount then
TableInfo.InsertRows(TableInfo.RowCount, RowCount - TableInfo.RowCount, -1);
with TableInfo.Cells[RowCount - 1, 0] do begin
DeleteItems(0, ItemCount);
AddNLWTag(tmp, TextStyleId, ParaStyleId, 0);
if Odd(RowCount) then
Color := $DDDDDD;
end;
TableInfo.EditCell(RowCount - 1, 0);
TCustomRVFormattedData(TableInfo.Cells[RowCount - 1, 0].Edit).SelectAll;
Inc(RowCount);
end;
On EditCell call I get error
---------------------------
Debugger Exception Notification
---------------------------
Project SE_sample.exe raised exception class EListError with message 'List index out of bounds (-1)'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------