Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread "Integral height" of TGrid Cells
Tue, Feb 2 2016 6:31 AMPermanent Link

Uli Becker

Tim,

Please have a look at the attached screenshot. I hope I can make clear
what I mean Smile

On the left you see a TGrid with a vertical scrollbar. The last visible
row is displayed completely, the next row is not drawn, because there is
not enough space.

The grid on the right side is a fake - since I need colored cells (the
color depends on other values of the current record) I couldn't use
TGrid. It's just a TScrollPanel with 4 BasicPanels for each row, all
created on the fly.

As you see, the last visible record is partially drawn.

Since I use very thin scrollbars (especially for tablets) the user might
think that there are no more records in the left grid and might miss to
scroll down. That's why I would prefer a partially drawn last (visible)
record.

What do you think about that?

Thanks Uli



Attachments: Clip7.png
Tue, Feb 2 2016 12:20 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< The grid on the right side is a fake - since I need colored cells (the color depends on other values of the current record) I couldn't use TGrid. >>

You *can* do colored cells dependent upon other values in the current row.  It's just a little more work if the grid is bound to a dataset because you'll need to "look up" the row in a different dataset instance in order to avoid moving the row pointer in the grid.

<< Since I use very thin scrollbars (especially for tablets) the user might think that there are no more records in the left grid and might miss to scroll down. That's why I would prefer a partially drawn last (visible) record. >>

I'll see what I can do, but what you're describing is supposed to be covered by the scrollbar functionality.  That's one of the primary purposes of scrollbars, regardless of what Google/Apple decided to do in terms of making UI discovery worse. Wink

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Feb 3 2016 8:22 AMPermanent Link

Uli Becker

Tim,

> You*can*  do colored cells dependent upon other values in the current row.  It's just a little more work if the grid is bound to a dataset because you'll need to "look up" the row in a different dataset instance in order to avoid moving the row pointer in the grid

Can you please elaborate? How would a lookup within the OnCellUpdate
event work?

Thanks Uli
Wed, Feb 3 2016 2:43 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< Can you please elaborate? How would a lookup within the OnCellUpdate event work? >>

As long as the two datasets have the same set of rows in the same sort order, you can use the Index property of the TGridCell to determine the cell index, add it to the TGrid.RowOffset property to determine the row index, and then use that row index to position the row in the lookup dataset (set the TDataSet.RowNo property to this row index) and grab the relevant data.

It's a little convoluted, but it's the only way to avoid triggering recursive updates to the grid cells when moving around the row pointer in the dataset bound to the grid.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Feb 4 2016 3:17 AMPermanent Link

Uli Becker

Tim,

thank you - understood now.

Uli
Fri, Mar 11 2016 7:18 AMPermanent Link

Ivan Mihailov

Hi,

TGrid.RowOffset is a protected property and is not available within the OnCellUpdate event.


Tim Young [Elevate Software] wrote:

Uli,

<< Can you please elaborate? How would a lookup within the OnCellUpdate event work? >>

As long as the two datasets have the same set of rows in the same sort order, you can use the Index property of the TGridCell to determine the cell index, add it to the TGrid.RowOffset property to determine the row index, and then use that row index to position the row in the lookup dataset (set the TDataSet.RowNo property to this row index) and grab the relevant data.

It's a little convoluted, but it's the only way to avoid triggering recursive updates to the grid cells when moving around the row pointer in the dataset bound to the grid.

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Mar 11 2016 8:00 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ivan,

<< TGrid.RowOffset is a protected property and is not available within the OnCellUpdate event.  >>

Which version of EWB are you using ?  It's not protected in the latest versions:

http://www.elevatesoft.com/manual?action=viewprop&id=ewb2&comp=TGridControl&prop=RowOffset

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Mar 11 2016 8:15 AMPermanent Link

Ivan Mihailov

Hi Tim,

you are right, my version of EWB is rather old, v.201 build 2
Sorry for that,  I need to upgrade Smile

Ivan


Tim Young [Elevate Software] wrote:

Ivan,

<< TGrid.RowOffset is a protected property and is not available within the OnCellUpdate event.  >>

Which version of EWB are you using ?  It's not protected in the latest versions:

http://www.elevatesoft.com/manual?action=viewprop&id=ewb2&comp=TGridControl&prop=RowOffset
Image