Autor Beitrag
gamoes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 86



BeitragVerfasst: Di 09.05.06 17:18 
Wie kann ich den Inhalt einer DBGrid-Zelle editieren bzw auch eine Zeile daraus löschen?

Hab schon mal folgendes probiert:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure Tfrm_Rechnung.DBGridReDatenDblClick(Sender: TObject);
begin
  DBGridReDaten.SetFocus;
  DBGridReDaten.EditorMode:=True;
end;


aber da passiert nichts.
Die Eigenschaft ReadOnly des DBGrid steht auf False.

Gruß
Gabi

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 09.05.06 17:20 
Ein DBGrid visualisiert ein DataSet. Am besten ist es, die Manipulationen an diesem durchzuführen. wenn das nicht möglich ist, ist zu überprüfen, ob das DataSet editable ist (je nach Datenbank oder Abfrage nicht unbedingt gegeben )

_________________
Markus Kinzler.
gamoes Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 86



BeitragVerfasst: Di 09.05.06 18:04 
wo seh ich denn das?
Habe ja die Odac-Komponenten und hab schon mal geschaut bei den Eigenschaften, aber bisher nichts gefunden.

Gruß
Gabi
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 09.05.06 18:25 
Das kommt sehr auf das DBMS ( Oracles kanns sicherlich), die verwendeten Komponenten und die Abfrage an. Verwendest du einen JOIN?

_________________
Markus Kinzler.
gamoes Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 86



BeitragVerfasst: Di 09.05.06 19:30 
Nein, ist nur eine einfache Abfrage:
select * from redaten where kdnr=rkdnr

Gruß
Gabi
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 09.05.06 19:37 
Was für eine Query-Komponenet nimmst du? SmartQuery?

_________________
Markus Kinzler.
gamoes Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 86



BeitragVerfasst: Di 09.05.06 20:50 
Bisher hatte ich die normale oraQuery genommen und hab überlegt, ob ich besser die SmartQuery nehme. In nem anderen Projekt hab ich die schon einmal genutzt.

Gruß
Gabi
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 09.05.06 20:52 
Nimm einen SmartQuery, dann kannst du angeben, wie das dataSet upgedatet werden soll.

_________________
Markus Kinzler.
gamoes Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 86



BeitragVerfasst: Di 09.05.06 21:22 
ok werd ich machen.
Muss ich dann über update den Datensatz im DBGRid löschen? also dann eigentlich im SmartQuery?

Gruß
Gabi
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 09.05.06 21:34 
Wenn das Grid mit dem SmartQuery verbunden ist, reicht ein .Delete im Query.

_________________
Markus Kinzler.