Board index » delphi » TDBGrid
u...@helsingborg.se (Stefan Andersson)
Delphi Developer |
Thu, 18 Jun 1998 03:00:00 GMT
|
u...@helsingborg.se (Stefan Andersson)
Delphi Developer |
Thu, 18 Jun 1998 03:00:00 GMT
TDBGrid
Are there any way to select whitch fields to be shown in the DBGrid.
(I do not whant all fields in the table) /Stefan |
Guillaume MAIS
Delphi Developer |
Thu, 18 Jun 1998 03:00:00 GMT
Re:TDBGridQuoteu...@helsingborg.se (Stefan Andersson) wrote: form, double-click on the TTable component. click on the Add button of the new form (fields list), and add all the fields of your table. then, click on a field and set its visible attribute to false or true, depending on if you want it to be visible or not. then when you will set the datasource property of your DBGrid, only hope this helps. guillaume |
Stefan Anderss
Delphi Developer |
Fri, 19 Jun 1998 03:00:00 GMT
Re:TDBGridThis sems to be a good solution, but can this be don at runtime? /Stefan |
Guillaume MAIS
Delphi Developer |
Fri, 19 Jun 1998 03:00:00 GMT
Re:TDBGridQuoteu...@helsingborg.se (Stefan Andersson) wrote: ie : you have a table with two fields : Table1 in your code, you will have something like that : TFormx = class(TForm) Then, you can access any properties of the field. To declare these field in your code, just double-click on the TTable guillaume |
Arro
Delphi Developer |
Sun, 21 Jun 1998 03:00:00 GMT
Re:TDBGridIn <4c6106$...@news.helsingborg.se> u...@helsingborg.se (Stefan QuoteAndersson) writes: When the screen comes back remove those fields you don't want. In the case of the primary key just highlight that field and go to the Object Inspector. Set the Visible property to false. You can also change the Display lable in the Object Inspector. Ben Arrow |
Andrew Ga
Delphi Developer |
Tue, 23 Jun 1998 03:00:00 GMT
Re:TDBGridQuoteIn article <4c6106$...@news.helsingborg.se> u...@helsingborg.se (Stefan Andersson) writes: To eliminate the field from the grid set Grid.Fields[I].Visible to true. WARNING: Only visible fields are included in the Grid.Fieldcount, and How you get fields back, I don't know. Anyone? Andrew |
Arro
Delphi Developer |
Fri, 26 Jun 1998 03:00:00 GMT
Re:TDBGridIn <Andrew.Gabb.563.30EC8...@dsto.defence.gov.au> QuoteAndrew.G...@dsto.defence.gov.au (Andrew Gabb) writes: object inspector by highlighting a field to select its width and visiblity. You can also remove fields form the list (not the primary key) when you double click the tTable component. Ben Arrow |
William M. Buis
Delphi Developer |
Sat, 27 Jun 1998 03:00:00 GMT
Re:TDBGridThe easiest way is to double clickthe table or sql icon and then click add. This gives a list of fields and selecting them allows you to transfer the data to a variable the properties and events you can set. One of the propoerties is visible so this can be set bot at design and run time. Display properties and formating are also available. Hope this helps In article <Andrew.Gabb.563.30EC8...@dsto.defence.gov.au>, Andrew Gabb Quote>In article <4c6106$...@news.helsingborg.se> u...@helsingborg.se (Stefan William M. Buist |
Harald Fjerdingst
Delphi Developer |
Mon, 29 Jun 1998 03:00:00 GMT
Re:TDBGridWhat is the most correct way of solving the TDBGrid DisplayWidth problem? A. By changing Grid.Fields Harald |
Harald Fjerdingst
Delphi Developer |
Tue, 30 Jun 1998 03:00:00 GMT
Re:TDBGridQuote>WARNING: Only visible fields are included in the Grid.Fieldcount, and out on my computer. And when Visible is set to FALSE it's removed from the fields list. So what I wanted was a way to toggle a fields "visibility". Here comes the solution: Imagine a DBGrid displaying all the columns from the CUSTOMERS.DB in from the Harald |