Autor Beitrag
MasterHiggins
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64



BeitragVerfasst: Mo 03.03.03 10:23 
Hallo,

Ich habe ein DBGrid über eine ADO-Connection an eine bestehende DBase Datenbank angeschlossen (muß leider DBase sein).

Nun wird ja im "Spaltentitel" immer der "echte" Name der Spalte angezeigt. Ich würde diesen aber für die Anzeige durch einen Klartext ersetzen wollen. Geht das irgendwie?
Weil so wie ich es bis jetzt probiert habe will Delphi dann gleich den Spaltentitel in der Datenbank ersetzen.

Danke im voraus

MasterH
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mo 03.03.03 10:32 
Hallo,

das DBGrid verfügt über eine Eigenschaft Colums. Mit dieser Property kannst Du die Spaltentitel umbenennen.

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
kiwicht
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1021

Win 7, MacOS
Delphi x, VBA, PHP, ...
BeitragVerfasst: Mo 03.03.03 10:37 
hi ho

kloar geht das, geht alles.. :D

Zitat:

// Hier der Titel
Grid1.Columns[6].Title.Caption := 'GUTEN TACH';


mfg
kiwicht
MasterHiggins Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64



BeitragVerfasst: Mo 03.03.03 10:44 
Ok, columns.
und wie sage ich dann welche Spalte, bzw. das jetzt der Titel dieser column geändert werden soll?

Ich meine z.B. (geht natürlich NICHT genau so)
ausblenden Quelltext
1:
2:
DBGrid1.columns[1].Titel:='test1';
DBGrid1.columns[2].Titel:='test2';

Wie mache ich jetzt diese Zuordnung?

Moderiert von user profile iconTino: Code-Tags hinzugefügt.
MasterHiggins Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64



BeitragVerfasst: Mo 03.03.03 10:45 
Hatte den zweiten Beitrag noch nicht gesehen!
MasterHiggins Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64



BeitragVerfasst: Mo 03.03.03 10:47 
Dann funktionierts auch, Danke!

(Habe in meinem Beispiel doch gar nicht mal schlecht geraten!)

MfG

MasterH