Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-11

Locking down a string grid

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

If using a string grid in a panel on a form, with the grid set r/o and the containers sized to be a good fit, what's the right way to prevent the user from moving the selected cell which is causing the grid to move around the available space?

Is it possible to disable the selected-cell marker, i.e. to make the grid completely passive?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Jesus Reyes

--- El mar 30-nov-10, Mark Morgan Lloyd escribi?:

Is it possible to disable the selected-cell marker, i.e. to make the grid completely passive?

if you write an OnSelectCell event handler for the grid which do:

procedure TForm1.gridSelectCell(Sender: TObject; aCol, aRow: Integer;
? var CanSelect: Boolean);
begin
? CanSelect := false;
end;
The grid is effectively locked-down as there is no available cell to select, if you want also to hide the focus rectangle do grid.FocusRectVisible := false;

Reply by email