Puffeltje
2015-02-21T23:52:46Z
Can someone help me?
I'm using igrid V3.0
i try to save the gridlayout as soon as a column is dragged to another position. For a test i use the following code:

    Private Sub grd2_ColHdrEndDrag(sender As Object, e As TenTec.Windows.iGridLib.iGColHdrEndDragEventArgs) Handles grd2.ColHdrEndDrag
        Console.WriteLine(grd2.LayoutObject.Text)
    End Sub

    Private Sub grd2_ColHdrStartDrag(sender As Object, e As TenTec.Windows.iGridLib.iGColHdrStartDragEventArgs) Handles grd2.ColHdrStartDrag
        Console.WriteLine()
        Console.WriteLine(grd2.LayoutObject.Text)
    End Sub
i get the following result when i drag a column to a different place:

<iGridLayout><Col Index="-1"><Order>-1</Order></Col><Col Index="0"><Order>3</Order></Col><Col Index="1"><Order>0</Order></Col><Col Index="2"><Order>1</Order></Col><Col Index="3"><Order>2</Order></Col><Col Index="4"><Order>4</Order></Col></iGridLayout>
<iGridLayout><Col Index="-1"><Order>-1</Order></Col><Col Index="0"><Order>3</Order></Col><Col Index="1"><Order>0</Order></Col><Col Index="2"><Order>1</Order></Col><Col Index="3"><Order>2</Order></Col><Col Index="4"><Order>4</Order></Col></iGridLayout>


is it true that layoutobject.text is identical at the beginning of the dragging and at the end of the dragging? Isn't it supposed to be different in the enddrag-event?
Igor/10Tec
2015-02-23T14:56:24Z
The e.DoDefault parameter of the ColHdrEndDrag event allows you to cancel the drag operation. Having this, it becomes clear why the column order reported by the LayoutObject is the same. The column has not been moved yet because it will be done only if we allow this in a ColHdrEndDrag event handler.

To implement the desired functionality, use the ColOrderChanged event. It occurs after the columns have been 'physically' reordered in the grid.