after LoadFromSpreadsheetFile, cells loose editing capabilities lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- CapelliC · 2020-09-16 15:47 Sorry the (most probably) stupid question, I cannot find the right options to enable cells editing after a file have been loaded. I have this minimal code, that works like a charm, but I'm unable to change the content *after* the file has been loaded. procedure TForm1.OpenExcelFileClick(Sender: TObject); begin   if OpenDialog1.Execute then     sWorksheetGrid1.LoadFromSpreadsheetFile(OpenDialog1.FileName); end; procedure TForm1.SaveAsClick(Sender: TObject); begin   if SaveDialog1.Execute then     sWorksheetGrid1.SaveToSpreadsheetFile(SaveDialog1.FileName); end; I have managed to modify the content adding     a sCellEdit1: TsCellEdit; and a     sWorkbookSource1: TsWorkbookSource; to connect the sWorksheetGrid1 to sCellEdit1, and tried (again) to check/uncheck options/goEditing and AutoEdit, but to change a cell content I must enter the text in sCellEdit1 and press enter, which is strange, since it's required *only* after a file has been loaded. Could someone drop me an hint ? TIA, Carlo ---------------------------------------------------------------------- wp · 2020-09-16 16:25 You only must add goEditing to the Options of the grid in order to be able to edit a cell. In fact, I don't know exactly what AutoEdit is doing, it is inherited from the ancestor, TCustomGrid. See the attached demo in which you can load an xlsx file and you can check/uncheck the "read-only" combo to enable/disable editing at any time (before or after loading). ---------------------------------------------------------------------- CapelliC · 2020-09-17 07:23 Thanks, but the behaviour didn't change. Don't worry, I will keep the editing bar to enable modification. ---------------------------------------------------------------------- wp · 2020-09-17 07:42 Then I don't understand the issue. Please post a short compilable project which demonstrates the issue (only .pas, .lfm, .lpi and .lpr files, no compiler-generated files like .exe, .o., ppu etc; all packed to a common .zip which you can upload under "Attachment and other options"). ---------------------------------------------------------------------- CapelliC · 2020-09-17 10:05 What I mean is that also the project you provided (edit_grid) doesn't allow editing after loading. Anyway, here is my test project - where you can change content acting into the edit at top. I must say I've found anyway your sample code useful, suggesting the syntax required to change by code an option in the grid (I was using the form editor for my test), so I have verified that after loading, forcing the goEditing option  to true didn't solve my problem. ---------------------------------------------------------------------- wp · 2020-09-17 10:26 After you clicked the Open button the focus of the form is still on the button. So, when you begin typing the key presses are received by the button, not by the grid. After loading you must click into the grid to move the focus to it. Of course you can do this automatically when you call Worksheetgrid.SetFocus after loading: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.OpenExcelFileClick(Sender: TObject);begin  if OpenDialog1.Execute then    begin      sWorksheetGrid1.LoadFromSpreadsheetFile(OpenDialog1.FileName);      sWorksheetGrid1.SetFocus;    // <--------- ADDED      //sWorksheetGrid1.Options2 := sWorksheetGrid1.Options2 + [goEditing]; // wp: Use "Options", not "Options2" here.    end;end;