>>>I have a grid based on a framework gridclass with a columncount of -1. The grid in the form has column count = 6, recordsourcetype = 1-Alias, a valid recordsource, and I define the controlsource for each of the six columns as a specific column of the grid recordsource.
>>>
>>>When the form comes up, the columns show up with the first six columns of cursor, not the ones I defined as controlsources. I traced the init of the grid and from instant one it contains those values. I use Codemine.
>>>
>
>>Is there anything that changes grid's Recordsource.
>I don't think so.
>
>>What's the name of the Record source?
>v_Acudientes_Alumnos. It is an SQL PT cursor defined during form load that gets its properties changed so that changes can be be written to the server. I commented the code that changes cursor properties to see if that was the problem, but it wasn't.
>
>>Do you call grid's inot somewhere in the code?
>I presume you mean init. No.
>
>I think the problem is that the column count of -1 in the class somehow is prevailing over the value of 6 that I placed manually in the property sheet. Aside from showing the cursor columns in order, the grid has 11 columns, the same as the cursor, not six.
>
>What would make this happen?
>
>Thanks for your help, Nadya.
>
>Alex
Don't remember seeing this behavior, but I believe there was a similar thread...
Anyway, for start you may try to isolate a method, where this reconstruction occurs. For this reason, you may put
=messagebox(program()+" thisform.myGrid.ColumnCount "+transform(thisform.myGrid.ColumnCount))) in couple of form's and grid's methods and see, if you would be able to find the culprit...
If it's not broken, fix it until it is.
My Blog