Solved

Stringgrid read only column

Posted on 2000-03-28
6
2,037 Views
Last Modified: 2012-06-21
Is there a way to set a column in a stringgrid to read only and not allow it to be selected?
0
Comment
Question by:brettawv
  • 3
  • 2
6 Comments
 
LVL 2

Accepted Solution

by:
aubs earned 50 total points
ID: 2664378
Look at the OnSelectCell Event for the grid:

procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol,
  ARow: Integer; var CanSelect: Boolean);
begin
      if Acol=2 then CanSelect:= False;
end;
0
 
LVL 17

Expert Comment

by:inthe
ID: 2664386
hi,
sure you can do this:

procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol,
  ARow: Integer; var CanSelect: Boolean);
begin
// if column 2 is our read only column
if (acol = 2)  then canselect := false;
end;

Regards Barry
0
 
LVL 17

Expert Comment

by:inthe
ID: 2664388
:-)) too slow.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:aubs
ID: 2664451
Hi Barry

:-)
0
 

Author Comment

by:brettawv
ID: 2665733
Thanks.  I still need to know how to set focus to a different a cell. Can you help?
0
 
LVL 2

Expert Comment

by:aubs
ID: 2668679
You could try using the stringrid.selection property.

Regards
Aubs
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now