Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Mike Yearwood
  Where is Mike Yearwood?
 Toronto
 Canada
 Mike Yearwood
 To: Tom Saddul
  Where is Tom Saddul?
 Paranaque
 Philippines
 Tom Saddul
 Tags
Subject: RE: ordering grid by field
Thread ID: 189121 Message ID: 189168 # Views: 1 # Ratings: 0
Version: Visual FoxPro 7 Category: Grids
Date: Wednesday, August 13, 2008 3:55:54 PM         
   


> That's right. Just another solution (worse) but may be useful in other scenarios especially the use of INTO CURSOR clause and RecordSource property of the Grid.

No. That is not a "may be useful" solution. A solution should solve a problem. The into cursor clause and changing the RecordSource does not work. That causes the grid to disconnect.

Build a form. In the form's Load put this

SELECT * from (HOME()+"\SAMPLES\NORTHWIND\CUSTOMERS.DBF") into cursor c_Temp


Put a grid on the form. Set its RecordSource to "c_Temp". Set its columncount to 3. Set the columns to CustomerID, ContactName, CompanyName (which is not the sequence of the fields in the table).

Add a button to the form with this in the click
THISFORM.Grid1.RecordSource = ""
SELECT * from (HOME()+"\SAMPLES\NORTHWIND\CUSTOMERS.DBF") into cursor c_Temp
THISFORM.Grid1.RecordSource = "c_Temp"
THISFORM.Grid1.Refresh()


Now when you run the form, note the column contents. Then hit that button. Columns 2 and 3 exchange places. Problem is not solved.

You'd be better off using the safe select method Andy Kramek made famous.

Mike Yearwood
Microsoft MVP Visual FoxPro 2008



ENTIRE THREAD

ordering grid by field Posted by Tyrone Matthews @ 8/13/2008 1:08:53 PM
RE: ordering grid by field Posted by Jun Tangunan @ 8/13/2008 1:20:21 PM
RE: ordering grid by field Posted by tushar @ 8/13/2008 1:52:20 PM
RE: ordering grid by field Posted by Stefan Wuebbe @ 8/13/2008 1:59:13 PM
RE: ordering grid by field Posted by Jun Tangunan @ 8/13/2008 2:14:59 PM
RE: ordering grid by field Posted by Tom Saddul @ 8/13/2008 1:21:53 PM
RE: ordering grid by field Posted by Stefan Wuebbe @ 8/13/2008 2:10:07 PM
RE: ordering grid by field Posted by Tom Saddul @ 8/13/2008 2:21:42 PM
RE: ordering grid by field Posted by Mike Yearwood @ 8/13/2008 3:55:54 PM
RE: ordering grid by field Posted by Tom Saddul @ 8/14/2008 1:55:13 PM
RE: ordering grid by field Posted by Mike Yearwood @ 8/14/2008 7:30:26 PM
RE: ordering grid by field Posted by Tom Saddul @ 9/2/2008 11:41:02 AM
RE: ordering grid by field Posted by Mike Yearwood @ 9/2/2008 4:12:52 PM
RE: ordering grid by field Posted by Tom Saddul @ 9/3/2008 12:46:13 PM
RE: ordering grid by field Posted by Mike Yearwood @ 9/3/2008 3:45:18 PM
RE: ordering grid by field Posted by Marcia Akins @ 8/13/2008 6:22:41 PM
RE: ordering grid by field Posted by Tyrone Matthews @ 9/1/2008 12:02:55 PM
RE: ordering grid by field Posted by Marcia Akins @ 9/2/2008 12:54:59 PM
RE: ordering grid by field Posted by Olaf Doschke @ 8/14/2008 2:22:10 PM
RE: ordering grid by field Posted by Tyrone Matthews @ 8/15/2008 3:48:26 PM
RE: ordering grid by field Posted by Jun Tangunan @ 8/16/2008 12:37:31 AM
RE: ordering grid by field Posted by Olaf Doschke @ 8/16/2008 5:04:52 PM
RE: ordering grid by field Posted by Tyrone Matthews @ 8/20/2008 11:13:27 AM
RE: ordering grid by field Posted by Olaf Doschke @ 8/20/2008 1:02:53 PM
RE: ordering grid by field Posted by Anders Altberg @ 8/16/2008 9:46:42 PM