>I have a classed grid which has 10 columns many of which are sortable, and I would like to be able to sort on some columns which are added programatically to this grid. Normally the code for this would go in the header click, but I have no way of accessing the Header Click event when these columns are added programatically. Does anyone have a workaround?
Define a header class in the .prg; in the code, after adding a new column, column.Newobject("hdr1","yourheaderclass","your.prg"). This will automatically delete your old header. You may want to column.hdr1.name="header1" if your code expects such a name. The trick is that you can't add an objet named Header1 while the old one still exists, but you can add a header with any other name.
The header class should have all the code in it, of course, but you probably have that code in the existing columns already. Just make it generic enough to be able to apply it to any column it may appear in.