Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid recordsource
Message
De
13/08/1998 12:07:23
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00126368
Message ID:
00126568
Vues:
24
>>>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform