Board index » cppbuilder » TDBGrid problem: How to disable horizontal scroll bar?

TDBGrid problem: How to disable horizontal scroll bar?

I have crazy problem recently - I don't know if that is possible to disable
horizontal ScrollBar in TDBGrid? I tried million ways but failed... :( I
desperatelly tried to find that in documentation and it seems like there is
no such option...

Dejan

 

Re:TDBGrid problem: How to disable horizontal scroll bar?


Quote
Dejan Lekic wrote:

> I have crazy problem recently - I don't know if that is possible to disable
> horizontal ScrollBar in TDBGrid? I tried million ways but failed... :( I
> desperatelly tried to find that in documentation and it seems like there is
> no such option...

The Horizontal ScrollBar is only there if all Collums together are wider
than
the Width of TBGrid. How does the users has to vieuw the coverd collums
if no
Horizontal ScrollBAr is there ?

If you still want a solution:

Place the TDBGrid on a TPanel with the same Width.

In the OnRezize event of the Panel place the following code:

        DBGrid1->Height = Panel1-Height + 18;

Hans.

Re:TDBGrid problem: How to disable horizontal scroll bar?


That doesn't solve my problem... :(
Users can view columns in my TDBGrid allways because the width of grid is
not bigger than width of control itself...

I could'n also find the way to make grid "fit" whole space of control...

My control looks like this:

+--TDBgrid control----------------------+
|+--grid--+-----------------+-----+     |
||  ID    | Name            | Num |     |
|+--------+-----------------+-----+     |
|+--------+-----------------+-----+     |
|+--------+-----------------+-----+     |
|+--------+-----------------+-----+     |
+---------------------------------------+

Is there some way to resize the grid to fit the width of control? It's
possible with StringGrid but I couldn't find some way to do that with
TDBgrid...

Thanks a lot anyway :) !

Dejan Lekic <dejan € linuks.org>

Re:TDBGrid problem: How to disable horizontal scroll bar?


Heheh,
Hans thanks for this workaround ... :) It helped.

Btw. is there some easy solution to expand columns in DBgrid to fit the
width of DBgrid ?

Best regards

Dejan Lekic [de...@1inux.org]

Other Threads