>I have a grid class that handles record validation, field format and inputmasks, header texts, new records, highlighting current row etc. I can control methods at the grid level and default grid builder works for me well. Now I want to use mycolumn, myheader classes as well. I can programmatically define these classes but how can I make them to be used in the form designer ?
>Cetin
They have to be assigned at runtime. Following is some code from my smartgrid class;
FOR lnCount = 1 to this.ColumnCount && Loop through all of the columns of the grid
if llUseCustomHeader then
lcColumn.RemoveObject("header1")
lcColumn.AddObject("myheader1",lcheader)
endif
lcColumn = this.Columns[lnCount]
do case
case type(lccolumn.controlsource) = "C"
lcColumn.RemoveObject("text1")
lcColumn.AddObject("mytext1",lctext)
lcColumn.mytext1.visible = .T.
lcColumn.sparse = .F.
case type(lccolumn.controlsource) = "N"
lcColumn.RemoveObject("text1")
lcColumn.AddObject("mynumeric1",lcnumeric)
lcColumn.mynumeric1.visible = .T.
lcColumn.sparse = .F.
case type(lccolumn.controlsource) = "L"
lcColumn.RemoveObject("text1")
lcColumn.AddObject("mylogical1",lclogical)
lcColumn.mylogical1.visible = .T.
lcColumn.sparse = .F.
.
.
. && whatever other types you want to provide for.
.
otherwise
lcCcolumn.RemoveObject("text1")
lcCcolumn.AddObject("mytext1","Mytext")
endcase
ENDFOR
This code obviously won't work directly in your class, but you can get an idea of what you can do. I hope this is sort of what you were looking for.
Erik Moore
Clientelligence