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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show specific fields in GRID

Status
Not open for further replies.

cmergal

MIS
Oct 16, 2002
18
US
Hello;

I have a cursor and I want to show the user some fields from this cursor using a GRID without creating a new cursor or table. For example, the cursor has fields1 - field60 and I want to show the user field1, field4, field5, field7. But I need the rest of the data to be there but "hidden".

Is there a simple way to do this?

Thanks for the help...




 
Hi,

As you told, if you select the rowsource type as "cursor1". Then after in the Refresh Event of the Cursor you write the following.

thisform.grid1.setall("VISIBLE",.f.,"Column")
THISFORM.GRID1.COLUMN1.VISIBLE = .T.
THISFORM.GRID1.COLUMN4.VISIBLE = .T.


The 1st line of the above code make invisible of all the columns.


HTH,

suggestions Invited...

gchandrujs [sunshine]

 
Hi,

As you told, if you select the rowsource type as "cursor1". Then after in the Refresh Event of the Cursor you write the following.

thisform.grid1.setall("VISIBLE",.f.,"Column")
THISFORM.GRID1.COLUMN1.VISIBLE = .T.
THISFORM.GRID1.COLUMN4.VISIBLE = .T.


The 1st line of the above code make invisible of all the columns.

And then you call the Refresh () method after setting the rowsource of your grid.


HTH,

suggestions Invited...

gchandrujs [sunshine]

 
Hi

myGrid.Init
***********
This.Visible = .f.
This.ColumnCount = 4
This.RecordSource = "myCursor"
This.Columns(1).ControlSource = "myCursor.Field1"
This.Columns(2).ControlSource = "myCursor.Field4"
This.Columns(3).ControlSource = "myCursor.Field5"
This.Columns(4).ControlSource = "myCursor.Field7"
This.Visible = .t.

The table stays there.. only the grid which is the way for user to browse contains the limited fields.
:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Thanks very much for the hints. Both ways gave me what I was looking for but ramani's solution was more precise on what I needed.

Again thanks [thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top