Board index » delphi » Can't assign to Selection Property

Can't assign to Selection Property

I need to change the selected cells in a TStringgrid so I want to assign to
the Selection property. The manual (for Tcustomgrid.selection) even tells me
to set this property to achieve this effect, but when I try, I get a
compiler error that "left side cannot be assigned to".

I run Delphi v3.0 Build 5.53.

 

Re:Can't assign to Selection Property


You didn't show your code, so I can't tell you what's wrong. Here's an
example that works:

  StringGrid1.Selection := TGridRect(Rect(2, 2, 3, 3));

Good luck.

Kurt

Re:Can't assign to Selection Property


My code was something like this:

    selection.top:=1;

Thanks for your help.

Kurt Barthelmess (TeamB) <71333.2...@compuserve.com> wrote in message
<3719389a.1980...@forums.borland.com>...

Quote
>You didn't show your code, so I can't tell you what's wrong. Here's an
>example that works:

>  StringGrid1.Selection := TGridRect(Rect(2, 2, 3, 3));

>Good luck.

>Kurt

Other Threads