Solved

Stringgrid read only column

Posted on 2000-03-28
6
2,187 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

728 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