Solved

Stringgrid read only column

Posted on 2000-03-28
6
2,059 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Simple Delphi Question 9 89
Using idhttp to login to instagram 2 89
Delphi: Connect to running MS Outlook 4 80
Base1 Encode/Decode 3 77
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 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