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: Paul Culbertson
  Where is Paul Culbertson?
 Katy
 Texas - United States
 Paul Culbertson
 Tags
Subject: RE: How to set focus to a specific line in a grid??
Thread ID: 294 Message ID: 303 # Views: 5 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Tuesday, May 22, 2001 12:26:35 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
>
Hi Asmed,
Bearing the above in mind.
Lets go back to basics
You are using the table aliases??

I would have thought and invoice header and line items linked
So two grids on formA
grid two has items

button for look up of item code. opens new form for look up -assume yes
before calling lookup =
vcall = "lookup" &&public variable

On selection in lookUp
select items
append blank
replace item code with;
invi_no with etc.etc
vrec = recno

FormA got focus Event code =
If vcall = "lookup" && returning from item lookup
select item
go vrec
thisform.grid2.setfocus
vcall = ""
endif

Now if Grid still shows selected record at top??
A Seem to remeber something like this before.

Remeber LISA
On start up on the Events are processed in the following order adn are not normally called thereafter

Load
Initial
Show

Lets see what's next
HTH
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