Board index » delphi » How to show columns alignment tidily in DBGrid?

How to show columns alignment tidily in DBGrid?

Hi, guys:
       I can hardly find a properity to set columns filling in client
area, that is, no matter what a form expand, the right border keeps
{*word*154} in grid's right side.

thank you every much in case fof any help!
Delphile's Rhapsody Realm

juli...@pc2.hinet.net

 

Re:How to show columns alignment tidily in DBGrid?


In <46qku9$...@serv.hinet.net> juli...@pc2.hinet.net (Julian Wang)
writes:
Quote

>Hi, guys:
>       I can hardly find a properity to set columns filling in client
>area, that is, no matter what a form expand, the right border keeps
>hanging in grid's right side.

>thank you every much in case fof any help!
>Delphile's Rhapsody Realm

>juli...@pc2.hinet.net

You can set the width of the grid column and the title of the column
thru the object inspector when you open the fields editor
Ben
Arrow

Re:How to show columns alignment tidily in DBGrid?


Quote
arr...@ix.netcom.com (Arrow ) wrote:
>You can set the width of the grid column and the title of the column
>thru the object inspector when you open the fields editor

thanks, but it seems a bit misunderstanding......

the situation is : I set the DBGrid "client" align properity, but all
the widths of columns inside grid are fixed, so somehow a gap
appears on the right side when we expand the form, how to fill
totally in grid like the "client"alignment  in a form?

again, thank you very much for any answer!

Delphile's Rhapsody Realm

juli...@pc2.hinet.net

Re:How to show columns alignment tidily in DBGrid?


Quote
juli...@pc2.hinet.net (Julian Wang) wrote:
.arr...@ix.netcom.com (Arrow ) wrote:

.
.>You can set the width of the grid column and the title of the column
.>thru the object inspector when you open the fields editor
.
.thanks, but it seems a bit misunderstanding......
.
.the situation is : I set the DBGrid "client" align properity, but all
.the widths of columns inside grid are fixed, so somehow a gap
.appears on the right side when we expand the form, how to fill
.totally in grid like the "client"alignment  in a form?
.
.again, thank you very much for any answer!

add an event handler to your Form.OnResize and adjust the column widths

(TQryField[0].DisplayWidth := x; etc) {it's actually the TField(s) in
the dataset as
                                        as opposed to the DBGrid column width}

to fill the DBGrid's new width in whatever proportions you want;

David Hewick

Re:How to show columns alignment tidily in DBGrid?


 > I can hardly find a properity to set columns filling in client
 > area, that is, no matter what a form expand, the right border keeps
 >{*word*154} in grid's right side.
 > thank you every much in case fof any help!

 You could try DBScroll, a DBGrid replacement. In DBScroll _always_ the
column(s) fit exact in the client area. You can get a Trial version at:
  http://sunsite.icm.edu.pl/~robert/delphi/ftp/shareware/dbscroll.zip
or
  ftp://ftp.orst.edu/pub/mirrors/simtel/win3/delphi/dbscroll.zip

Regards,
 Jan.

** DBscroll = the faster DBGrid **

Other Threads