trichview.support
Re: Table cells iteration |
Author |
Message |
zet |
Posted: 11/19/2003 11:28:57 Sergey Tkachenko wrote: > 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; I've got it. I have another question, connected with the first one. Try to run attached sample and push button Restore sel. It works ok (it doesn't show the selection, but it doesn't matter, in this case). But if you click in right cell of any table and press Restore sel again, you'll get an error. So, the question is - how should I select the items in a table cell? |
Powered by ABC Amber Outlook Express Converter