>If you do not know how many columns you will have in your grid,
>is it possible to know which header has been clicke?
>
>I need that to sort the column by the data in it.
Prior to VFP8 you would do it by substituting default header with your own header class for each column. There is GridSorting sample in Downloads section by Vlad Grynchyshyn, which uses this technique. I have such class developed based on Vlad's, David F and Cetin Basoz ideas. Drop me a note (click on envelope), if you want that class and sample code...
If it's not broken, fix it until it is.
My Blog