This site is temporarily down. Please come back. Setting read-only columns in StringGrid
DelphiFAQ Home Search:

Setting read-only columns in StringGrid

 

comments9 comments. Current rating: 5 stars (6 votes). Leave comments and/ or rate it.

From: Mark Pritchard
In the OnSelectCell event, this works fine (every even column is editable)

if Col mod 2 = 0 then
  grd.Options := grd.Options + [goEditing]
else
  grd.Options := grd.Options - [goEditing];

Content-type: text/html

Comments:

2006-07-05, 10:22:39
anonymous from Turkey  
rating
2006-07-22, 23:33:06
anonymous from Australia  
rating
Col should be ACol?
2006-10-07, 05:00:31
anonymous from Switzerland  
Yes, ACol returns the column index.
2008-06-01, 03:12:30
Drone from Azerbaijan  
what's the point? You can just set CanSelect on True or False
2009-06-13, 04:02:08
anonymous from Indonesia  
chip dech
2009-10-22, 10:24:28
DAVID VAN MTZ from Cuautitlán Izcalli, Mexico  
rating
THANKS A LOT!!
2009-12-29, 03:59:53
kumar babu from India  
rating
Thank you
2012-12-30, 10:41:42
anonymous from Argentina  
rating
Thanks!
2016-03-10, 03:26:08
anonymous from Thailand  
rating
The answer was great! I am using a String to display data, which should be readonly, but just one column (with style cbsCheckboxColumn) should be editable. Now it works, thanks a lot!

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: