I got it. After further experimenting, the only things you have to do is change the name of the columns (in the Properties field of the Grid record) to the names that VFP will generate.
For example, if your class is named myColumn, then you have to change "column1" to "myColumn1". The same for the headers (there is one header record for each header of each column), in case you have changed headerClass for the column class. You have to change too the header class, but not the header classLoc.
This will break some code if you reference columns(x).header1 for example, and means hacking all forms with grids on them (I always base controls on my classes).
One way to avoid breaking everything is to define the column and header class as follows:
define Class jColumn as Column
headerClass = 'jHeader'
headerClassLibrary = 'class_columns.prg'
name = 'column'
procedure init()
return doDefault()
endproc
endDefine
define Class jHeader as Header
alignment = 2
name = 'header'
procedure init()
return doDefault()
endproc
endDefine
What's important is to include the "name" property, and VFP will take it and add integers for form the final names for columns and headers. Using "column" and "header" as the standard name you will come up with the same names.
I made this change and I was able to open all of my forms without hacking them.
One gotcha: is you see the "class" property of the coliumns and headers, VFP says "column" instead of "jColumn", and "header" instead of "jHeader". The classLibrary property is OK, but not the class. I think this is a bug, but it does not affect, as all of the properties in the custom classes are inherited OK.
>>Hi all, I recently changed the memberClass and memberClassLibrary properties of my grid base class.
>>I new I was goin to break all the grids in forms, but I thought I could solve it by hacking the SCX files.
>>I tried to hack them but with bad results.
>>
>>Does someone know what do I have to tweak in the SCX so that the columns defined in my grids become columns of the class defined in myGrid.memberClass?
>>
>>Thanks is advance,
>>Javier.
>
>Try this but do a good backup first, keep in mind I not tested it:
>
>USE YourForm.SCX
>SET FILTER TO BaseClass == "Grid"
>LOCATE
>BROWSE
>
>*Go to Properties field and change MemeberClass row
>
>After that recompile the form