Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Move columns in grid ?
Wed, Oct 19 2016 7:29 AMPermanent Link

Luk

Hi,

I would like to add an extra button to the header of a grid. When the user clicks this button, it will open a window where the user can change the order of the columns.

- Is it possible to move for example the last column of a grid to position 2 ?
- Is it possible to add a button to the header of a grid ? Taking the source from the grid and adding the button ? Or is there an easier way to do this ?

Thanks

Regards,
Luk
Wed, Oct 19 2016 4:09 PMPermanent Link

Trinione

Lux:
<< - Is it possible to move for example the last column of a grid to position 2 ? >>

Set the grid colum index value to the desired index
grdcolName.Index := 1;


<< - Is it possible to add a button to the header of a grid ? Taking the source from the grid and adding the button ? Or is there an easier way to do this ?  >>

I don't think it is possible. Considering the complexity of this I would instead use the Layout properties and set the DisplayOrder value to overlay the Button and move it along.
Tue, Oct 25 2016 2:08 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Luk.

<< Is it possible to add a button to the header of a grid ? Taking the source from the grid and adding the button ? Or is there an easier way to do this ?  >>

Yes, the TGridColumn.Header property is just a TGridHeader control, which is a normal control that can be a parent for other controls.

However, I still wouldn't do what you're describing, because it's going to screw up the way that the caption/sizer/arrow UI elements work in the header.

Tim Young
Elevate Software
www.elevatesoft.com
Image