Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread How to find the TGrid Width without the Scroll Bar?
Mon, Apr 13 2015 3:22 AMPermanent Link

Doug B

I'm writing a routine to automatically size the columns in a TGrid, however I need to factor the scroll bar width it into my calculations.

Is there a way to determine the width of a TGrid without the scroll bar?

Thanks,
Doug
Mon, Apr 13 2015 3:25 AMPermanent Link

Doug B

Further to my question above, I need to know when the scrollbar is visible or not (i.e., the vertical scroll bar will be visible only when the number of items exceeds the height of the grid control).

Thanks,
Doug
Mon, Apr 13 2015 3:47 AMPermanent Link

Uli Becker

Doug,

I'd suggest to wait for the final release. I discussed this problem with
Tim and probably there will be a way to stretch the last column to the
right.

Uli
Mon, Apr 13 2015 3:53 AMPermanent Link

Matthew Jones

Doug B wrote:

> Further to my question above, I need to know when the scrollbar is
> visible or not (i.e., the vertical scroll bar will be visible only
> when the number of items exceeds the height of the grid control).

It's a good question. Me, I used a screen grab and counted pixels,
added a fudge, and assumed it was always there. If EWB2 was able to
standardise this it would be good.

--

Matthew Jones
Mon, Apr 13 2015 11:18 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Doug,

<< I'm writing a routine to automatically size the columns in a TGrid,
however I need to factor the scroll bar width it into my calculations.

Is there a way to determine the width of a TGrid without the scroll bar? >>

In EWB 2 it's easy, you just simply get the width of the client area like
this:

MyGrid.ClientWidth

It's harder in EWB 1 since EWB 1 isn't managing the scrollbars.  You have to
go down to the DOM element level and do some calculations:

http://stackoverflow.com/questions/13382516/getting-scroll-bar-width-using-javascript

As you can see, there are good reasons why this type of thing is managed by
EWB in EWB 2. Smile

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Apr 13 2015 11:20 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Doug,

<< Further to my question above, I need to know when the scrollbar is
visible or not (i.e., the vertical scroll bar will be visible only when the
number of items exceeds the height of the grid control). >>

This information is present in EWB 2, but isn't surfaced.  It's easy to do
so, though, so I'll see about adding some properties for this.

As Uli indicated, there will be ability to stretch the last column to fill
all available space in the final TGrid, but that may not work for you if
you're trying to do something like distribute the available space among all
grid columns.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Apr 13 2015 12:55 PMPermanent Link

Doug B

Tim,

<<
This information is present in EWB 2, but isn't surfaced.  It's easy to do
so, though, so I'll see about adding some properties for this.
>>

That would be very helpful, thanks!

<<
As Uli indicated, there will be ability to stretch the last column to fill
all available space in the final TGrid, but that may not work for you if
you're trying to do something like distribute the available space among all
grid columns.
>>

Yes, that's exactly what I'm doing, but that setting will be useful for other situations. Wink

Thanks,
Doug

BTW:  EWB is truly an amazing product.  I'm still experimenting with it, but In 1 day using the trial, I achieved what would have taken me weeks,  including some advanced control manipulation that I wouldn't have dared try with another product.  I can't say enough great things about it and can only imagine what V2 will offer! Smile
Mon, Apr 13 2015 4:58 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Doug,

<< BTW:  EWB is truly an amazing product.  I'm still experimenting with it,
but In 1 day using the trial, I achieved what would have taken me weeks,
including some advanced control manipulation that I wouldn't have dared try
with another product.  I can't say enough great things about it and can only
imagine what V2 will offer! Smile>>

EWB is much nicer to deal with, so if you like EWB 1.x, then you'll really
like 2. Smile

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com
Image