Re: Lookupfields in grid.. Disappear and reappear :S
From: Vitali Kalinin (vitkalinin_at_yahoo.com)
Date: 04/20/04
- Next message: Vitali Kalinin: "Re: adCriteriaAllCols and text columns"
- Previous message: Kevin Frevert: "Re: Identity error?? Please help"
- In reply to: Arnoud van Bers: "Lookupfields in grid.. Disappear and reappear :S"
- Next in thread: Arnoud van Bers: "Re: Lookupfields in grid.. Disappear and reappear :S"
- Reply: Arnoud van Bers: "Re: Lookupfields in grid.. Disappear and reappear :S"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 20 Apr 2004 15:31:13 +0300
Borland ADO wrapper have known problem with lookup fields. As far as I see
from your code you don't want lookup values to be editable, thus I suggest
you to modify underlying SQL of mySP in order to perform lookuping on server
side.
Regards,
Vitali
"Arnoud van Bers xlned.com>" <avbers@<REMOVE4SPAM> сообщил/сообщила в
новостях следующее: news:4084f113$1@newsgroups.borland.com...
> Hi There,
>
> I suffer from a vague problem:
> For lookupfields in a dbgrid I use a (parameterised) query, which executes
> fine but doesn't always show up in a grid...
>
> When opening the grid, I see the following (NOT CORRECT)
> Watch the first column:
>
> http://web10.ontwikkeling.ica.han.nl/1.gif
>
> After scrolling to the end and to the beginning again, I get the following
> result (CORRECT)
>
> http://web10.ontwikkeling.ica.han.nl/2.gif
>
> Suddenly all records are visible..
> At first I thought it would be a repaint or doublebuffering problem.. this
> is not the case!
>
> Code:
>
>
> myFKQuery := TADOQuery.Create(myGrid);
> with myFKQuery do
> begin
> Connection := DataMod.DBConn;
> DataSource := myGrid.Datasource;
> (Can this be a problem? It is absolutely necessary)
> CacheSize := 30;
> SQL.Text := DataMod.cdsColumns.Fields[24].AsString;
> end;
>
> with TStringField.Create(mySP) do
> begin
> ReadOnly := TRUE;
> mySP.Fields[k].Visible := FALSE;
> FieldName := myGrid.DataSource.DataSet.Fields[k].FieldName+'_';
> FieldKind:= fkLookup;
> DataSet := mySP;
> if DataMod.cdsColumns.Fields[2].AsString <> '' then DisplayLabel :=
> DataMod.cdsColumns.Fields[2].AsString;
> Name := FieldName;
> KeyFields:= mySP.Fields[k].FieldName;
> ReadOnly := TRUE;
> Size := 300;
> LookUpDataset:= myFKQuery
> LookUpKeyFields:= DataMod.cdsColumns.Fields[22].AsString;
> LookUpResultField:= mySL.Strings[0];
> mySP.FieldDefs.Add(Name, ftString, 300, false);
>
>
>
> The query is a parameterised query:
>
> SELECT OPLSAMENSTEL.* FROM OPLSAMENSTEL,MODULE B WHERE
> OPLSAMENSTEL.MODULEOPL=B.CODEMODULE and OPLEIDING = :OPLEIDING
>
> Can somebody explain this to me? (and have a solution?? :P)
>
> Greetz,
> Arnoud van Bers
>
> The Netherlands
>
>
- Next message: Vitali Kalinin: "Re: adCriteriaAllCols and text columns"
- Previous message: Kevin Frevert: "Re: Identity error?? Please help"
- In reply to: Arnoud van Bers: "Lookupfields in grid.. Disappear and reappear :S"
- Next in thread: Arnoud van Bers: "Re: Lookupfields in grid.. Disappear and reappear :S"
- Reply: Arnoud van Bers: "Re: Lookupfields in grid.. Disappear and reappear :S"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|