Trust you to have the best answer going Razzak!
Albert
On 2016-03-10 12:11 AM, A. Razzak Memon wrote:
At 01:34 PM 3/9/2016, Albert wrote:
I "borrowed" Razzak's Drag and Drop form, version 2, and it is slick.
I have
added some bit buttons to do various report variations when the user
selects
this and that. I would like to be able to stay in the list of
Customers (the
DrivingTableListView) and allow the user to select all of some
customers by
double clicking multiple times. The database has been upgraded to
v95(64),
but not yet to RBGXE. The database uses double quotes. The code for
the double
click is below. The code works fine and highlights the next line:
when the
Driving Table refreshes, the customer following the customer double
clicked
is selected, as it has moved up one line when it is added to the
temporary
table tSelectedValues. My problem is that the ITEMINDEX does not page
down
the lengthy list of customers. It indeed highlights the customer on
the second
or third page, but always returns to display the list from the top.
Has anyone
any ideas as to how I can get the list view to page down to the
ITEMINDEX that
is highlighted?
One of the customers has no less than 9 locations, each of which
(correctly)
appears in the list view. It would be more convenient to use if one
could just
double click 9 times without having to page down after each selection
to get
to the new highlighted value.
Albert,
You've got the right idea, but the wrong PROPERTY command to achieve
the goal <g>.
Use the Variable Lookup ListView TOPITEM GETPROPERTY/PROPERTY to
remember the
selected/highlighted row and the exact spot when refreshing the
ListView window.
Here's how ...
Use the following code as "On Double-Click EEP"
-- On Double-Click Custom EEP
SET VAR vTopItem TEXT = NULL
GETPROPERTY DrivingTableListView TOPITEM vTopItem
APPEND Customers TO tSelectedValues WHERE CustID = .vCustID
PROPERTY DrivingTableListView REFRESHLIST "TRUE"
PROPERTY DrivingTableListView TOPITEM .vTopItem
CLEAR VARIABLE vTopItem
RETURN
This will ALWAYS return the focus to the exact same highlighted row in
the
Variable Lookup ListView where you double-clicked the last time.
That's all there is to it!
2015 and 2016 SAT Sample applications include a form to illustrate the
use
of TOPITEM GETPROPERTY/PROPERTY in Variable Lookup ListView control.
Very Best R:egards,
Razzak.