?
Solved

How to set a TStringgrid into editing mode at runtime by a buttonclick?

Posted on 2005-04-12
5
Medium Priority
?
477 Views
Last Modified: 2010-04-05
Hi Folks!

I think the title is quite selfexplanatory if not let me know!

Regards Peter

(working sample will do the trick and it would be great if you would comment what you do)
0
Comment
Question by:PeterdeB
  • 2
  • 2
5 Comments
 
LVL 15

Expert Comment

by:mikelittlewood
ID: 13763572
A Stringgrid is editable anytime (unless you set the enabled property to false)
You just have to know what row and column is currently selected, or what you want to update, and use the cells[icol,irow] := 'value' to change something
0
 
LVL 15

Accepted Solution

by:
mikelittlewood earned 200 total points
ID: 13763702
o hang on .. do you mean altering the options of the stringgrid?

StringGrid1.Options := [goEditing]

dont forget to include all the other options that are needed

ON:
StringGrid1.Options := [goFixedVertLine,goFixedHorzLine,goVertLine,goHorzLine,goRangeSelect,goEditing]
OFF:
StringGrid1.Options := [goFixedVertLine,goFixedHorzLine,goVertLine,goHorzLine,goRangeSelect]
0
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 13763742
set the goEditing option as mikelittlewood suggested, then on the button Onclick event put:

  StringGrid1.SetFocus;
  StringGrid1.EditorMode:=True
0
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 13763758
you can use this on the Forms OnCreate event to allow editing at run-time

procedure TForm1.FormCreate(Sender: TObject);
begin
  StringGrid1.Options:=StringGrid1.Options+[goEditing]
end;
0
 

Author Comment

by:PeterdeB
ID: 13765751
Perfect!

Tnx for responding guys!

Regards Peter
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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 video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month16 days, 22 hours left to enroll

864 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