Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread How to hide a TGrid's selection
Thu, Nov 12 2015 3:59 AMPermanent Link

Uli Becker

I use a data bound TGrid just to show a number of favorite items and I
don't want any line to be selected.

I found this post:

<

<< 1. V1 TGrid.AlwaysShowSelection I set to False as grid is just a
display of information and I don't want any selection showing up. How to
do this in V2 ? >>

EWB 2's TGrid doesn't have an AlwaysShowSelection, so it will only show
a selection if the grid has focus.

>

I don't see this here. Unless I am doing something wrong with the
interface the selection is visible also without focus.

Uli
Thu, Nov 12 2015 7:00 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< I don't see this here. Unless I am doing something wrong with the interface the selection is visible also without focus. >>

That post of mine was backwards:  the row selection is *always* shown in a grid.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Nov 12 2015 7:55 AMPermanent Link

Uli Becker

Tim,

> That post of mine was backwards:  the row selection is *always* shown in a grid.

OK, then the solution will be to create a derived component with a
different interface, e.g. TNoSelectionGrid Smile

Uli
Thu, Nov 12 2015 8:07 AMPermanent Link

Trinione

Wouldn't setting the rowindex value to -1 work?

  DataSet1.RowIndex := -1;
Thu, Nov 12 2015 8:26 AMPermanent Link

Uli Becker

Trinione,

>     DataSet1.RowIndex := -1;

I guess you mean TGrid.RowIndex. And yes: that works, but has to be
executed each time a record has been selected.
Thanks.

Uli
Thu, Nov 12 2015 10:16 AMPermanent Link

Trinione

Correct on both counts. Guess a ShowHighlighter property would be nice. I myself have instances where I do not want it to be shown.
Image