Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ryss Unger
  Where is Ryss Unger?
 Cape Town
 South Africa
 Ryss Unger
 To: Asmed Miranda
  Where is Asmed Miranda?
 Lowell
 Massachusetts - United States
 Asmed Miranda
 Tags
Subject: RE: How to set focus to a specific line in a grid??
Thread ID: 294 Message ID: 311 # Views: 3 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Tuesday, May 22, 2001 1:56:42 PM         
   


> > > > > Hi all, am developing a point of sale application and using a grid to capture items to be sold, my problem is that let's say user is at line 3 of the grid but need to check the items database to find the item code to enter if not known, user presses f5 to get item lookups routine, once it's found return to grid with item code, but instead of landing from where it left it clears the grid and position at first line, previous items are not gone from grid because if i saved the sale and go to check sales database all line items are there.
> > > > >
> > > > > Thanks for any input on how to solve this.
> > > >
> > > > Hi ,
> > > > I think thisform.grid1.setfocus should do the trick but may depend on other code u have on gotfocuse event etc. Also this assumes record pointer is still on recNo() = 3. if not, select the alias and " go 3" and then set focus
> > > >
> > > > You do not spoecify your data source so let us know that.
> > > >
> > > > Also would only use F5 etc if no mouse avaiable.
> > > > HTH
> > > > R
> > > > Ryss
> > >
> > > One question, when user presses f5 or click to leave grid, when the code return focus to grid does it trigger grid.init event? cause am not able to see previous 2 line items but it takes me back to line item 3, am also not able to scroll up nothing come up but i know recno 1 and recno 2 are there.
> > >
> > > as for grid data source i have a line items sold database in relation to invoices number & customer # database.
> > >
> > > by the way, i end up removing this routine from the grid because tried diferent methods and nothing seems to work, but i know this grid should have an item lookup service, what i did was to place an option in the main menu to look up for items but again it implies the user leaving the grid and when gets back to the grid it's cleared and focus on first row but previous lines are sent to database if save transaction.
> > > Asmed
> >
> > Asmed,
> >
> > If you were using tablebuffering then you must issue a tableupdate before the records in the grid would be available to view again.
> >
> > Paul Culbertson
> >
> > Houston, TX
> >
>
> yes Paul, the thing is that i issue tableupdate just when the sales process end, since this sale affects clients database if credit sale, inventory database, profit database, etc. so i would not update the line items database until user is sure that process of sale is complete. but if i do the tableupdate prior to leave the grid and when focus gets back to grid i issue tablerevert will that do
> the trick?? may be?
>

Hi,
Now things are comming together.
I normally prepare the invoice in a local file . when all ok get next number and update databases as indicated

If user cancells current data no problems are created. easy to control, no missing reference nunbers etc
Ryss

ENTIRE THREAD

How to set focus to a specific line in a grid?? Posted by Asmed Miranda @ 5/22/2001 9:54:58 AM
RE: How to set focus to a specific line in a grid?? Posted by Ryss Unger @ 5/22/2001 10:07:41 AM
RE: How to set focus to a specific line in a grid?? Posted by Asmed Miranda @ 5/22/2001 11:06:05 AM
RE: How to set focus to a specific line in a grid?? Posted by Paul Culbertson @ 5/22/2001 11:52:12 AM
RE: How to set focus to a specific line in a grid?? Posted by Ryss Unger @ 5/22/2001 12:26:35 PM
RE: How to set focus to a specific line in a grid?? Posted by Eric den Doop @ 5/22/2001 12:55:55 PM
RE: How to set focus to a specific line in a grid?? Posted by Asmed Miranda @ 5/22/2001 1:02:32 PM
RE: How to set focus to a specific line in a grid?? Posted by Ryss Unger @ 5/22/2001 1:56:42 PM