Hi Nancy,
Thanks for reply,
>Setting the columncount to -1, "specifies that the Grid control should contain enough columns to accommodate all the fields in the grid’s record source." (That's from the help.) Do you actually want to set the columncount to zero?
>this.resettodefault('columncount')
Also for Erik (thanks for the reply) ,
Actually I've enough problem with this grid repainting,
I'm building a grid with a crosstab recordsource, everytime the crosstab fires, grid always changes it shapes, so I made grid shapes programatically ,I put a blank grid to a form, then changes all the properties needed in grid.repaint() method, so everytime crosstab code fires, I have to make this.grid.recordsource to default (" ") and also columncount, then the grid repaint itself in repaint() method.
I also create a possiblity to add a new field or remove existing field to the grid.controlsource and that makes the grid have to add or remove column.
I set columncount=0 and recordsource=' ' before, but the result isn't good enough.
Well, this code actually too long for me to explain, but that's the global idea.
Grids don't have controlsources.
>this.resettodefault('controlsource'
Ooopss sorry I mean 'recordsource'
Senna.
Senna Dwipayana
Being good is better
Being better is a bless