>Hi all.
>
>I'am using Fox 7.
>I have a grid with approx 15 columns all with their own control source.
>My users would like to changes the columns to suit themselves each with their own preference.
>
>However if you move the columns around the order is not saved and reverts back to the original order if you exit the form and come back into it again.
>
>Thanks in advance
>Zaheed
Zaheed,
Once a grid is loaded its columns(n) always points to same column no matter how you move, size the column. You could utilize this fact to save/restore. Below is a sample doing that at runtime, you could enhnace the code to persist it per user in a table or ini file during form close and restore in form.init. For demonstration I assume you have a grid on the form named myGrid and 2 buttons for save and restore :
Create Cursor temp (ColOrder i, Width i)
With Thisform.myGrid
For ix=1 To .ColumnCount
With .Columns(ix)
Insert Into temp Values (.ColumnOrder,.Width)
Endwith
Endfor
Endwith
Select temp
With Thisform.myGrid
Scan
With .Columns(Recno())
.ColumnOrder = ColOrder
.Width = Width
Endwith
Endscan
Endwith
Cetin