Manual Initiation of Dragging Column?

Hi Bruno,

Is there  a way to manually initiate the Column-Move capabilities?

Here's what I'd like to do. I'd like to be able to select multiple columns with the mouse by clicking on the fixed cells. This can be accomplished "out-of-the-box" using the "MouseOptions -> ColSelect" property. I'd also like to re-order the columns.  This can be accomplished using the "Options -> goColMoving" option. 

However, the two options don't working together. So what I'd like to do is to let the user select multiple columns by default. If the user has "Ctrl" pressed then the grid moves the column.  To do this I'll need to test for the "Ctrl" key (not a problem) when the user click on a fixed cell. I'll then need to manually initiate the Column move. My question is, how do I manually initiate the column move?



Steve, I just moved the post to grids, because it doesn't seem to be FlexCel related, and I don't really know much about AdvGrid.


Sorry Adrian - I thought I had put it in Grids, my mistake, thanks for moving!


The built-in column moving feature is column by column. There is unfortunately not a built-in option to move multiple columns in one operation.

Sorry Bruno, that's not what I'm wanting to do. Here's a quick video:

Is this possible?



You could implement OnColumnMove like:

procedure TForm5.AdvStringGrid1ColumnMove(Sender: TObject; ACol: Integer;
  var Allow: Boolean);
  allow := getkeystate(VK_CONTROL) and $8000 = $8000;

Thanks Bruno - 

That works, although I don't seem to be able to switch off the Column Select as the Column is moved.  I'll keep trying.

Thanks again,