Autor Beitrag
LonghornUser
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Mo 23.04.07 14:23 
Hallo,

wie kann ich aus einer TTable- oder einer TDataSource-Komponente einzelne Zellen auslesen (wie beim StringGrid einfach über Cells[x,y]) ?
Als Grid Komponente nutze ich das TDBAdvGrid von TMS.

Danke schonmal.
Ciao LHUser
raiguen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 374

WIN 2000prof, WIN XP prof
D7EP, MSSQL, ABSDB
BeitragVerfasst: Mo 23.04.07 18:29 
Nutze dazu das OnCellClick-Ereignis:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure DBGrid1CellClick(Column: TColumn);
begin
  DBGridZellInhalt := column.Field.Value;
end;

Inwieweit das TAdvDingensGrid dieses Ereignis unterstützt, vermag ich nicht zu sagen, da ich diese Kompo (bisher) noch nicht im Einsatz habe.
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Mo 23.04.07 19:21 
Ich möchte aber mit einer Schleife alle Einträge einer Spalte in eine Listbox haben. Daher fällt ein Klickereignis auf das Grid schonmal aus.
Gibt es eine Möglichkeit, wie ich das bewerkstelligen kann?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 23.04.07 21:05 
Moin!

user profile iconLonghornUser hat folgendes geschrieben:
Ich möchte aber mit einer Schleife alle Einträge einer Spalte in eine Listbox haben. Daher fällt ein Klickereignis auf das Grid schonmal aus.
Gibt es eine Möglichkeit, wie ich das bewerkstelligen kann?

Wo ist denn dein Problem? :gruebel:

Wenn das Grid deinen Datensatzzeiger steuert (was ich mal annehme), dann kannst du doch einfach über Table1.FieldValues[] zugreifen... :nixweiss:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
raiguen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 374

WIN 2000prof, WIN XP prof
D7EP, MSSQL, ABSDB
BeitragVerfasst: Mo 23.04.07 21:17 
Hab hier mal einen Blick auf die Hilfe zum TDBAdvGrid geworfen und dabei ist mir u.a. folgendes an Eigenschaften(Properties) aufgefallen:

ausblenden Quelltext
1:
2:
3:
4:
5:
property Cells[c, r: Integer]: String read GetCellEx write SetCellEx; 

Description

Sets the cell contents as string.

ausblenden Quelltext
1:
property GridCells[c, r: Integer]: string read GetGridCell write SetGridCell;					

Abgeleitet von TStringGrid:
ausblenden Quelltext
1:
2:
property Cols[Index: Integer]: TStrings;
property Rows[Index: Integer]: TStrings;

Damit dürfte m.E. etwas für dich dabei sein :gruebel: