Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reference VALUE in a row/column of Grid
Message
From
17/10/2001 00:42:10
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
 
 
To
15/10/2001 00:04:10
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00568385
Message ID:
00569400
Views:
31
Hi Nancy

I have posted this ques in various forms, and as usual, got excellent replies that unfortunately don't always work for me. Then I come up with other ideas, like this one, and that sounds like it won't work either.

Here is my problem:

I have a form were 99% of the control of it is from a single textbox called tSearch. The majority of the form is covered by a grid (duuuhh) that displays approximately 14 rows of a table at a time. The current row (record) is completely highlighted with a blue background. This grid is 100% uneditable. Basically it is a columnized, nicely formatted and headed, listbox.

In the interactivechange of tSearch, as the user types the, the table/grid is searched letter by letter for the closest match... the hilight and record change as this proceeds. Works great.

I also control the KeyPress event of tSearch. This catches:
- ENTER: fires a small form that gets quantity and a potential price change. When that form is finished, changes are REPLACED in the current record and the form is refreshed to show the current changes.
- Up & Dn arrows: moves the highlight and the record accordingly
- Alt-Key: a few combinations to fire the appropriate buttons on the form instead of mouse clicks all the time.

Finally, the problem child: PgUp & PgDn. This originally worked well, moved the current displayed records accordingly with DOSCROLL calls. The current recordsource (&highlight) never moved (which was acceptable at first). The problem arose when you hit an arrow or enter... it works off the "current" record, jumps the grid back, and goes from there.

What I want now is a proper scrolling grid with PgUp/PgDn... that is:
- PgUp:
- Highlight/Record at 1st row on page... jump one complete page back and
highlight & recordsource to that first row record
- Highlight/Record NOT on first row on this page... jump up to first row
on page and move highlight/recordsource accordingly
- PgDn:
- Highlight/Record at last row on page... jump one complete page next and
highlight & recordsource to that last row record
- Highlight/Record NOT on last row on this page... jump dn to last row
on page and move highlight/recordsource accordingly

I am having LOTS of problems getting to that row and displaying it properly. I have tried various mathematics to get the current location using header size, grid size, ActiveRecord, etc, etc. Many needed setfocus calls to the grid temporarily to get the current row info, etc.

Alot of times, the scrolls caused the highlighted row to be the MIDDLE of a grid listing due to SKIP calls etc.. the grid automatically moved it to the middle during the SKIP call.

I thought, maybe if I point black new the data actually in the cell(s), I might be able to move the grid better manually... that is, get it to basically function like a grid/listbox but keeping the uneditable and proper highlighting for the current row, etc.

I even looked at some grid tools on here and other sites but they just don't seem to work the way I need.

Does this help explain my situation?



-



>>Is there a way to reference the value in a specific row/column in a grid... one that may NOT be the current active cell?
>
>Column is easy (just reference the columns() collection, or a field if it's bound, but the row is harder. It's not possible with the row, not without changing the record pointer. Or, you could have another copy of the recordsource open.
>
>What do you need to do? Maybe a detail would make it easier to make recommendations?
Peter Brama
West Pointe Enterprises

VFP is getting easier but STILL alot to learn!!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform