trichview.com

trichview.support




Re: Table cells iteration


Return to index


Author

Message

Sergey Tkachenko

Posted: 11/18/2003 18:00:29


Use Cell.GetRVData when accessing cell's items, otherwise you not get items

in a cell which is currently being edited:



procedure TForm1.Button1Click(Sender: TObject);

var

    item: TCustomRVItemInfo;

    table: TRVTableItemInfo;

    rv_e: TCustomRichViewEdit;

    r, c, z:integer;

begin

if rve.GetCurrentItemEx(TRVTableItemInfo, rv_e, item) then begin

table:=trvtableiteminfo(item);


   for r:=0 to table.Rows.Count-1 do

    for c:=0 to table.Rows[r].Count-1 do begin

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

      for z:=0 to table.Cells[r, c].GetRVData.ItemCount-1 do begin

        showmessage(table.Cells[r, c].GetRVData.GetItemText(z));

      end;

     end;

    end;

end;

end;



> Hello

>

> I've attached a little project to illustrate the problem I've found

> recently. You should click inside one of the cells and then push the

> button. I've expected the programm to show the contents of both cells of

> the table. But it shows only contents of the cell, which is not

> selected. What's wrong with the code?

>





Powered by ABC Amber Outlook Express Converter