Autor Beitrag
Tabakbrummel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 124

win 7
Turbo Delphi, VS 20010 Express
BeitragVerfasst: Mi 17.10.07 20:24 
Hallo

Mein Problem ist ich möchte vom DBGrid spalten über den DualListDlg von Delphi ein/ausblenden. Also im SrcList habe ich die Spalten von der DBGrid eingetragen. Und nun möchte ich wenn der String im DstList übernommen wird das sich z.B. Spalte 1 vom DBGrid ausblendet. Wie würde es gehen?

_________________
MfG
Tabakbrummel
Tabakbrummel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 124

win 7
Turbo Delphi, VS 20010 Express
BeitragVerfasst: Do 18.10.07 00:00 
Hallo

Ich habe es hinbekommen.

DBgrid spalten ausblengen

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
  for I := 0 to DstList.Items.Count - 1 do
  begin
  if DstList.Items.Strings[I]='Spalte1' then
   Form1.DBGrid1.Columns[1].Visible := False;
  if DstList.Items.Strings[I]='Spalte2' then
   Form1.DBGrid1.Columns[2].Visible := False;
  end;


und DBgrid spalten einblenden

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
  for I := 0 to SrcList.Items.Count - 1 do
  begin
  if SrcList.Items.Strings[I]='Spalte1' then
   Form1.DBGrid1.Columns[1].Visible := True;
  if SrcList.Items.Strings[I]='Spalte2' then
   Form1.DBGrid1.Columns[2].Visible := True;
  end;

_________________
MfG
Tabakbrummel