Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grid function

Status
Not open for further replies.

LenaS

Technical User
Nov 28, 2000
98
US
I would like to display data records in a grid vertically instead of horizontally. This way I can see all the fields for each record on the screen at the same time. Is this possible in VFP6?
 
Yes,

you would have to make a container in which you display all the fields of your table.

Make a grid with one column. In this column make the current control your container iso the default text box.

There was an item on this one in one of FoxPro advisor magazines in 1999 I believe.

But I hope you get the picture.

HTH,
Weedz (Wietze Veld)
veld4663@exact.nl

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
I'm sorry to be dense, but I don't understand. Do you know what magazine, do they have online access to past issues?
 
I'm not sure if you'll get the format you're after, but you can get the grid to render vertically by setting the VIEW property to 3.

Jim
 
Hi LenaS,

To see what I mean have a look at this picture from my site:


What you see is a grid with one column. Iso of the standard textbox control in the column, I made a container class and replaced the text box control with my container. The result is what you see in the picture.

This will enable you to see all data fields vertically iso the standard horizontal representation.

You can also download the application in which I programmed it from my site, so you can see clearly what I mean.


HTH,
Weedz (Wietze Veld)
veld4663@exact.nl

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
I built a grid with 1 column. I created a container with my fields in it. I tried to enter my container's name into the current control property of the column and get illegal value error.
 
That is absolutely correct.

Here is what you can do:

In the init() event of the column put the following code:

THIS.RemoveObject('Text1')
THIS.AddObject('MyContainer', 'MyContainer') && MyContainer represents the container you made.

THIS.CurrentControl = "MyContainer"
THIS.SPARSE = .F.
THIS.MyContainer.VISIBLE = .T.

Give it a try, it will give some nice effect.

HTH,
Weedz (Wietze Veld)
veld4663@exact.nl

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
Done but nothing shows up in my grid. BTW , where will records 1,2,3,4,5 go if only a 1 column grid is made?
 
Well, they will also show data in your container (which shows your data vertically) but actually it is still a horizontal presentation. (Just as in the image I refereed to in my previous post in this thread see:
What you see in the image ar all records in the table.

Have you checked if your container is actually added to the grid and if its visible property is set to .T. when you run your form ??




Weedz (Wietze Veld)
veld4663@exact.nl

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
BTW here is the code I used to make the grid look like the image I referred to:

This is the init() event of the grid.
PROCEDURE INIT
*-------------------------------------
*- SE: Wietze Veld
*- DateTime: 11/01/00 03:32:47 PM
*-------------------------------------
LOCAL llRetVal

llRetVal = DODEFAULT()

IF llRetVal
WITH THIS
.COLUMNCOUNT = 1
WITH .Column1
.ADDOBJECT('cnt_crndata', 'cnt_crndata')
.REMOVEOBJECT('Text1')
.REMOVEOBJECT('Header1')
.cnt_crndata.VISIBLE = .T.
.WIDTH = .cnt_crndata.WIDTH
THIS.ROWHEIGHT = .cnt_crndata.HEIGHT
.CURRENTCONTROL = "cnt_crndata"
.SPARSE = .F.
ENDWITH
ENDWITH
ENDIF

RETURN llRetVal
ENDPROC Weedz (Wietze Veld)
veld4663@exact.nl

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top