Subject | Re: TIB_LookupCombo inside TIB_Grid |
---|---|
Author | marcoandrecarvalho |
Post date | 2005-02-24T13:19:03Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
Thank you again, Helen!
I forgot to select the DisplayField of the IB_LookupCombo...I did not
give attention in this. Bad thing...
But thank you again!
[]s, Marco André
> At 08:18 PM 23/02/2005 +0000, you wrote:just
>
>
> >Hi All!
> >
> >Can anyone give me or put a link of some example on how to put a
> >TIB_LookupCombo inside a TIB_Grid? I want to make the following
> >like the example that comes with IBO (X:\IBODir\Samples\Company'),I
> >mean, just put TIB_LookupCombo inside a TIB_Grid.A
> >
> >I´ve already tried this with 2 tables:
> >
> > FABRICANTE (Lookup):
> > CD_FABRICANTE SMALLINT PK
> > NM_FABRICANTE VARCHAR(30)
> > /
> > /
> > /
> > <
> > ANTENA (Master):
> > CD_ANTENA SMALLINT PK
> > ID_FABRICANTE SMALLINT FK
> > DESCRIPTION VARCHAR(40)
> >
> >Setup:
> >
> >TIB_Query1 -> TIB_DataSource1 - Master
> >TIB_Query2 -> TIB_DataSource2 - Lookup
> >TIB_Grid -> TIB_DataSource1
> >
> >Assuming all components are clear (Default):
> >
> >IB_Query1.SQL.Text := 'SELECT CD_ANTENA,' +
> > 'ID_FABRICANTE,' +
> > 'DESCRICAO,' +
> > '(' +
> > ' SELECT NM_FABRICANTE' +
> > ' FROM FABRICANTE F' +
> > ' WHERE F.CD_FABRICANTE=A.ID_FABRICANTE ) AS
> >NOMEFABR' +
> > ' FROM ANTENA A;';
> >
> >IBQuery1.KeyLinks.Text := 'CD_ANTENA';
> >IBQuery1.KeyRelation := 'ANTENA';
> >IBQuery1.GeneratorLinks.Text := 'Antena.CD_ANTENA=SEQ_ANTENA_FABR';
> >
> >IBQuery1.OrderingItems.Add('CD_ANTENA=CD_ANTENA;CD_ANTENA DESC');
> >IBQuery1.OrderingItems.Add('DESCRICAO=DESCRICAO;DESCRICAO DESC');
> >IBQuery1.OrderingItems.Add('NOMEFABR=NOMEFABR;NOMEFABR DESC');
> >
> >IBQuery1.OrderingLinks.Add('CD_ANTENA=ITEM=1');
> >IBQuery1.OrderingLinks.Add('DESCRICAO=ITEM=2');
> >IBQuery1.OrderingLinks.Add('NOMEFABR=ITEM=3');
> >
> >IBQuery1.OrderingItemNo := 1;
> >IBQuery1.RequestLive := True;
> >
> >IBQuery2.SQL.Text := 'SELECT * FROM FABRICANTE;';
>
>IBQuery2.KeyLinks.Text := 'FABRICANTE.CD_FABRICANTE=ANTENA.ID_F
> >BRICANTE';A
>
>IBQuery2.KeyDescLinks.Text := 'FABRICANTE.NM_FABRICANTE=NOMEFABR';
>
>
>
>IBQuery2.MasterLinks.Text := 'Fabricante.CD_FABRICANTE=Antena.ID_F
> >BRICANTE'; // ? Needed ?('CD_FABRICANTE=CD_FABRICANTE;CD_FABRICANTE
>
> No, it will break the KeySource-Lookup relationship.
>
>
> >IBQuery2.OrderingItems.Add
> >DESC');('NM_FABRICANTE=NM_FABRICANTE;NM_FABRICANTE
> >IBQuery2.OrderingItems.Add
> >DESC');the
> >
> >IBQuery2.OrderingLinks.Add('CD_FABRICANTE=ITEM=1');
> >IBQuery2.OrderingLinks.Add('NM_FABRICANTE=ITEM=2');
> >
> >IBQuery2.OrderingItemNo := 1;
> >IBQuery2.RequestLive := True;
> >IBQuery2.KeySource := IB_DataSource2;
> >
> >Then I placed the IBGrid on the form and a TIB_LookupCombo inside
> >Grid, just as the manual says (Controls.hlp):palette.
> >
> >"Attention: First click on the grid to select it within the Delphi
> >designer, then click on the TIB_LookupCombo icon in the tool
> >Finally click on the grid again and the selected TIB_LookupCombowill
> >show up within the grid. This is the magic trick to make a notthe
> >standalone lookup rather than one which is automagically used by
> >grid!"set is
> >
> >After all, I didnt succeed. What is wrong or what do i have left?
>
> Remove the master-detail linking. Logically, it is the inverse of
> KeySource-Lookup.
>
> And realise that the embedded lookupcombo will not appear until the
> in edit or insert mode.Hi Helen,
>
> Helen
Thank you again, Helen!
I forgot to select the DisplayField of the IB_LookupCombo...I did not
give attention in this. Bad thing...
But thank you again!
[]s, Marco André