Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid recordsource
Message
 
To
13/08/1998 12:07:23
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00126368
Message ID:
00126597
Views:
23
>>>>I have a grid on a form that holds resultant data from a select into a cursor. I make the cursor updateable and then use this cursor as the recordsource for the grid. All works fine until a user grabs a header and moves that column to another position in the grid and then does another search. I've tried setting bound to .T. and setting the controlsource of the column and textbox to the correct field, but no such luck. The grid columns are still being populated by the cursor using the order in which the fields are selected in the select statement. For instance, if I move column 1(by dragging the header) to column 3, and re-query, column1 will be populated with column 3's field and not the field that I have placed in the controlsource for column1. Is there a way to (no matter where a user drags a column of a grid) make sure that the columns recieve the correct field from the cursor as its controlsource?
>>>>
>>>>Thanks,
>>>>
>>>>John.
>>>
>>>John, you need to remember each Column.ControlSource and re-set them again after creating the new cursor.
>>>
>>>Nick
>>
>>
>>Hi Nick,
>>
>>Thanks for responding.
>>
>>When I set the controlsource do I set it for the column, or the active control for the column i.e(textbox,checkbox etc.)?
>>
>>Thanks,
>>
>>John.
>John,
>Just for the columns. Others inherit.
>
dimension aCurrentControlSources[this.columncount]
>for each oColumn in this.columns
>    aCurrentControlSources[oColumn.columnorder] = oColumn.controlsource
>endfor
>* Requery etc here
>for each oColumn in this.columns
>    oColumn.controlsource = aCurrentControlSources[oColumn.columnorder]
>endfor
>Cetin


Thanks Cetin!
Previous
Reply
Map
View

Click here to load this message in the networking platform