Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   TAdvStringGrid(TMS), DirectEdit, goEditing +/- (https://www.delphipraxis.net/160718-tadvstringgrid-tms-directedit-goediting.html)

hoika 27. Mai 2011 15:28

TAdvStringGrid(TMS), DirectEdit, goEditing +/-
 
Hallo #,

ich benutze obiges Grid.
DirectEdit ist True, d.h. klicke ich auf eine Zelle, kann ich direkt editieren.
Bestimmte Zellen sollen aber nicht editiert werden können.
Das mache ich über OnSelectCell und goEditing ausknippsen oder nicht.

Nu kommt es aber.
Das OnSelectCell kommt wohl zu spät.
Klicke ich auf eine Read-Only-Zelle,
danach auf eine Read-Write-Zelle, wird der Inplace-Editor nicht geffnet.
Erst bei nächsten Klick auf die gleiche Zelle.

Welches Ereignis sollte ich nehmen ?


Danke


Heiko

Jens01 27. Mai 2011 21:50

AW: TAdvStringGrid(TMS), DirectEdit, goEditing +/-
 
Ich bin nicht ganz dahintergestiegen, was Du genau willst.
Aber so setzt man einzelne Zellen auf readonly
Delphi-Quellcode:
procedure TForm1.AdvStringGrid1CanEditCell(Sender: TObject; ARow, ACol: Integer; var CanEdit: Boolean);
begin
  CanEdit := not (ACol in [2,4]);
end;
So die Inplace-EDitoren:
Delphi-Quellcode:
procedure TForm1.AdvStringGrid1GetEditorType(Sender: TObject; ACol, ARow: Integer; var AEditor: TEditorType);
begin
  case ACol of
  1: AEditor := edNumeric;
  2: AEditor := edComboEdit;
  3: AEditor := edSpinEdit;
  4: AEditor := edRichEdit;
  end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:26 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz