Autor Beitrag
Daniel L.
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 140
Erhaltene Danke: 14

W7, W8
TurboD Prof, Delphi Community
BeitragVerfasst: So 07.11.10 11:24 
Hi,

ich brauche ein datensensitives Steuerelement, bei dem der User Strings auswählen kann, jedoch der entsprechende Itemindex-Integer Wert mit einem Feld der DataSource verbunden ist.

Meine Rangehensweise wäre jetzt, eine TComboBox zu nehmen (ReadOnly := true), die dann über OnChange und OnCloseUp ect. auf die Datasource zugreift, bzw. anderherum auf die möglichen States der DataSource.OnStateChange reagiert.

Könnte man auch vielleicht einfacher TDBComboBox so verbiegen, dass das gewünschte Verhalten auftritt?

Danke schon mal und Gruss: Daniel


Zuletzt bearbeitet von Daniel L. am So 07.11.10 12:46, insgesamt 1-mal bearbeitet
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: So 07.11.10 11:31 
TDBLookupcombox ???
Daniel L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 140
Erhaltene Danke: 14

W7, W8
TurboD Prof, Delphi Community
BeitragVerfasst: So 07.11.10 11:48 
Da ist ja zum Nachschlagen aus einer zweiten Datenbank gedacht.
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: So 07.11.10 12:24 
Tabelle nicht Datenbank...

Wenn Du keine 2 Tabelle verwenden willst geht je nach Datenbank auch ein Query mit

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
Select Cast(1 as int) as ID,Cast('erste Option' as Varchar(100) as MyText

Union
Select 2,'zweite Option'

UNION

Select 3,'dritte Option'
Daniel L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 140
Erhaltene Danke: 14

W7, W8
TurboD Prof, Delphi Community
BeitragVerfasst: So 07.11.10 12:47 
Sorry, ich hab mich im Betreff geirrt - es geht um MyBase (nicht MySQL) - ist editert.
MyBase kann meines Wissens nicht SQL.

anyway - Danke