Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid from Cursor is 'Read Only' - I want to edit!
Message
De
22/06/1998 05:33:24
 
 
À
21/06/1998 13:35:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00110357
Message ID:
00110491
Vues:
24
>>I have a Grid whose Recordsource is a Cursor produced via a query. One of the fields is a logical field which is displayed using a checkbox. It all displays perfectly, but it won't allow me to edit the checkboxes. It says the field is 'Read Only'. I want to allow changes to the logical field via the checkboxes. Is there a way to do this? While the other columns of the Grid are marked ReadOnly, this column is definitely not.
>
>Results of an SQL query are readonly, hence controls bound to them are readonly.If you want to edit the results and have your changes written to the underlying tables, then you need to be using an updateable view. But, if you only want to edit the results of your query and then do your own thing with them, you can use this little trick:
>
>SELECT * FROM table INTO CURSOR temp1
>USE DBF('temp1') AGAIN IN 0 ALIAS newtemp
>USE IN temp1
>
>Now, new temp is an editable cursor, and you can set your view's recordsource to it

Thanks Erik, it worked perfectly when first creating the cursor. I had a problem when I was requerying the data when the cursor was already in memory, as it showed that the alias name was already in use. I got around that by checking if the editable cursor was USED(), then if so, copying the temp cursor to an array, zapping the editable cursor and appending the array. That meant that the grid could then be refreshed without breaking the link to its datasource!

Thanks again, it was a great help

David O'Brien
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform