TDBGrid: Selecting only one field to display using a TQuery 
Author Message
 TDBGrid: Selecting only one field to display using a TQuery

When working with Tquery components I found that it seems impossible to
display only a selected number of fields form a TQuery in a TGrid. I want
to be able to show one field form a TQuery in a tableview and the rest of
the data in normal fields. This so that it is easy to select some key data
from the list, and sea the details on the rest of the screen.
It also seams like it is not possible to fill a TDBlistbox with data from
the query.
Since the query is rerun from another form, I first suppected that I had to
refresh or update the list, but this didn't work either on the Listbox.
I would prefer to be able use the TGrig, but am also puzzled by the listbox problem.
Any suggestions?

Thanks a lot in advance from a cold but sunny Holland.
Martijn



Fri, 17 Apr 1998 03:00:00 GMT  
 TDBGrid: Selecting only one field to display using a TQuery
I think I can answer your first question...

Quote:

>When working with Tquery components I found that it seems impossible to
>display only a selected number of fields form a TQuery in a TGrid. I want
>to be able to show one field form a TQuery in a tableview and the rest of
>the data in normal fields. This so that it is easy to select some key data
>from the list, and sea the details on the rest of the screen.

Set TDBGrid.Fields[x].Visible to False for the columns you don't want to see.
They'll still be available in TQuery but won't show up in your grid.

-- John



Fri, 17 Apr 1998 03:00:00 GMT  
 TDBGrid: Selecting only one field to display using a TQuery

Quote:

> When working with Tquery components I found that it seems impossible to
> display only a selected number of fields form a TQuery in a TGrid. I want

Rightclick (or doubleclick) on your TQuery component, and use the field
designer to configure what the fields should look like and if they
should be visible or not. Real neat for displaying dates just the way
you want 'em, or setting editmask for phonenumbers.

=\
 *=- R.Moberg, author of CD-Player Pro! ftp.cica.indiana.edu:
=/                                      /win3/sounds/cdppro45.zip



Sat, 18 Apr 1998 03:00:00 GMT  
 TDBGrid: Selecting only one field to display using a TQuery

Quote:



>> When working with Tquery components I found that it seems impossible to
>> display only a selected number of fields form a TQuery in a TGrid. I want
>Rightclick (or doubleclick) on your TQuery component, and use the field
>designer to configure what the fields should look like and if they
>should be visible or not. Real neat for displaying dates just the way
>you want 'em, or setting editmask for phonenumbers.

But that would mean that you select which fields to display for the Query.
Doing so would prevent me from displaying the rest of the fields in normal
TEdit fields. I found setting the fields to invisble, works great but VERY SLOW
If anybody know what to do about that, please say so.
I can only hide the fields only shortly before I show the form. This is because
the table is the result of a Query,. Hiding the fields to early will cause a GPF
because Delphi doens't know how many fields there are to display.
Martijn.
--

...........................................................................
                     For every problem there is a solution
                           that is simple, beautiful
                                  and wrong
...........................................................................



Sun, 19 Apr 1998 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Lookup fields using more than one field

2. Selecting fields in TDBGrid

3. Display Memo field in TDBGrid

4. Q: How to insert Blob field by using TQuery

5. QuickReport and TQuery using Persistent Fields:HELP

6. Updating Interbase memo field using TQuery

7. Clearing a Datetime field using TQUERY + execSQL

8. TDBGrid - How Do You Read The Selected Row?

9. Select a row in TDBGrid

10. HELP : TDBGRID MULTI-SELECT

11. Builder: TDBGrid selected record

12. How do I know when the user selects another record in a TDBGrid

 

 
Powered by phpBB® Forum Software