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



BeitragVerfasst: Mi 03.05.06 17:43 
Wie ordne ich den Inhalt eines Edit-Feldes einer Spalte im DBGrid zu?

CRDBGrid1.Columns[21].Field:=Ed_AzubiNr.Text;

funktioniert ja nicht, da ein Text nicht einem Feld zugewiesen werden kann.
und
CRDBGrid1.Columns[21].Item:=Ed_AzubiNr.Text;

gibt es ja beim DBGrid nicht.

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: Mi 03.05.06 17:55 
Hallo Gabi, weise es besser dem Feld des DataSets zu, dann erscheint es automatisch im DBGrid.

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



BeitragVerfasst: Mi 03.05.06 20:35 
Hallo Markus,
sorry aber ich bin noch nicht so fit in Delphi, muss ich da schreiben:

CRDBGrid1.Columns[21].Field:=ora_qry['AZUBINR'];

Ich würde eher denken richtig ist:

Ed_Azubinr.TExt:=ora_qry['AZUBINR'];

aber dann würde der Inhalt nicht automatisch im DBGrid angezeigt, da der Inhalt des Edit-Feldes übernommen wurde aus einem anderen Fenster bzw. einer anderen Tabelle. Der Inhalt steht noch gar nicht in der Tabelle, deren Inhalt im DBGrid dann angezeigt werden soll.

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: Mi 03.05.06 20:42 
Wenn du den Inhalt des edits im Grid haben willst, mußt du dessen Inhalt in den DataSet schreiben:

ausblenden Delphi-Quelltext
1:
ora_qry.FieldByName('AZUBINR').Value  := StrToInt(Ed_Azubinr.Text);					

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



BeitragVerfasst: Mi 03.05.06 20:49 
Danke.

Gruß
Gabi