Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Headaches
Message
De
06/05/2015 22:09:59
 
 
À
06/05/2015 19:54:53
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01619483
Message ID:
01619488
Vues:
53
>>Hi All:
>>
>>I put a grid on my form.
>>
>>Two problems:
>>
>>1. I can't set the color of the header. I drill down to 'Header1' in a particular column and set the fore color and backcolor to blue, with no effect. It works if I do it for the column, but I can't get it to work for the header.
>>
>>2. How can I allow the user to enter values in the cells? The grid I'm creating is based on a sql statement, with one column. I then add columns in the init thus:
>>
>>
>>LOCAL lnColumns, i
>>
>>lnColumns = RECCOUNT('curCustomers') + 1
>>this.grdOrders.ColumnCount = lnColumns
>>
>>i = 0
>>
>>SELECT curCustomers
>>
>>SCAN
>>
>>	i = i + 1
>>	lcColumn = 'Column' + ALLTRIM(STR(i + 1))
>>
>>	this.grdOrders.&lcColumn..header1.Caption = desc
>>	this.grdOrders.&lcColumn..header1.Wordwrap = .t.
>>	this.grdOrders.&lcColumn..width = 75
>>	
>>ENDSCAN
>>
>>
>>I can't enter data in the first column or in any other column.
>
>Grid header colour: you can set it only if the Grid.Themes = .F.
>
>Data entry in grid: The first question is whether you want to be able to save the values that users may enter into the grid. If so, the Grid.RecordSource needs to be updatable. The result of a type 4 query is not updatable.
>
>Since you also need as many columns in the .RecordSource as you have grid columns, I'd be inclined to build an updatable cursor and use that to drive the grid. Use your SCAN loop to build a command something like
>
>CREATE CURSOR SomeCursor ( Col1 C( 10 ), Col2 C( 10 ), ... )
>
Or, if you can use SELECT - SQL to create a cursor with one column per customer, you could add the READWRITE clause at the end to make it updatable.

Thanks! That was a great help.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform