Page 1 of 1

Table and Cells

Posted: Tue Feb 10, 2009 8:07 pm
by Jmich
If I rve.SearchText in Table by a certain text was found and selected.

I would also like the cell (row and column) in a label.caption read.

For example, during a similar Stringgrid.
Label1.Caption: = 'Row:'+ IntToStr (Stringgrid.row);
Label2.Caption: = 'Col:' + IntToStr (Stringgrid.Col);

My question:

Is that when Richview.table .... possible?
If yes - then how!
Please if possible, a sample code

Best Regards

Jmich

Posted: Wed Feb 11, 2009 6:55 am
by Sergey Tkachenko
Do you want to know the position of edited cell?

Code: Select all

var rve: TCustomRichViewEdit;
  table: TRVTableItemInfo;
  Row, Col: Integer;

if not RichViewEdit1.GetCurrentItemEx(TRVTableItemInfo, rve, TCustomRVItemInfo(table)) then
  exit; // not in table;
if table.GetEditedCell(Row,Col)=nil then
  exit; // table does not have edited cell
Label1.Caption: = 'Row:'+ IntToStr (Row); 
Label2.Caption: = 'Col:' + IntToStr (Col);

Table and Cells

Posted: Wed Feb 11, 2009 8:25 am
by Jmich
Hi Sergey,

Thank you for quick help.
It works great!

Please excuse my bad English

Best Regards