Board index » delphi » Getting selected Row/Col info in String Grid

Getting selected Row/Col info in String Grid

3 Questions:

How can I get info about a selected Row, Column, and selected Cell in the String Grid ?  For example, if I know I selected the second column in a grid, what is the code to get that info extracted ? Ditto for selected Row.

Suppose I selected cell [5,1] in a grid.  What is the code get that info extracted ?

Suppose I want to get the value info that I selected in cell [5,1], what is the code to get that info ?

Thanks much !!!

 

Re:Getting selected Row/Col info in String Grid


Its too easy:

SelectedCol := Grid.Col;
SelectedRow := Grid.Row;
Content := Grid.Cells[5,1];

"Jedi Knight Disco Mike" <DiscoM...@Hotmail.Com> schrieb im Newsbeitrag
news:3de45a4f$1@newsgroups.borland.com...

Quote

> 3 Questions:

> How can I get info about a selected Row, Column, and selected Cell in the

String Grid ?  For example, if I know I selected the second column in a
grid, what is the code to get that info extracted ? Ditto for selected Row.
Quote

> Suppose I selected cell [5,1] in a grid.  What is the code get that info
extracted ?

> Suppose I want to get the value info that I selected in cell [5,1], what

is the code to get that info ?
Quote

> Thanks much !!!

Re:Getting selected Row/Col info in String Grid


On 26 Nov 2002 21:38:23 -0800, "Jedi Knight Disco Mike" <DiscoM...@Hotmail.Com> wrote:

Quote
>How can I get info about a selected Row, Column, and selected Cell in the String Grid ?
>For example, if I know I selected the second column in a grid, what is the code to get that info extracted ? Ditto for selected Row.

See the Row and Col properties. Note that if you have enabled row selection Col is meaningless, and if you've
enabled range selection you'll need to use the Selection property instead.

Quote
>Suppose I selected cell [5,1] in a grid.  What is the code get that info extracted ?

>Suppose I want to get the value info that I selected in cell [5,1], what is the code to get that info ?

If you mean the contents of the cell, see the Cells[][] property.

Other Threads