Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select row with keyshift! and keyDownArrow!

Status
Not open for further replies.

mastercontrol

Programmer
Apr 19, 2011
8
CH
Hi,

I need to make row selection without using mouse, only keyboard, - KeyShift! AND KeyDownArrow! OR KeyUpArrow!.

I found for clicked event, but not for keyboard use:

ll_selectedrow = getselectedrow(0)
// select range
IF KeyDown(keyShift!) THEN
IF ll_selectedrow = 0 THEN
This.SelectRow(row, True)
ELSE
This.SelectRow(1, False)
IF row > ll_selectedrow THEN
FOR ll_rc = ll_selectedrow TO row
This.SelectRow(ll_rc, True)
NEXT
ELSE
FOR ll_rc = row TO ll_selectedrow
This.SelectRow(ll_rc, True)
NEXT
END IF
END IF
// multi select
ELSEIF KeyDown(keyControl!) THEN
IF This.IsSelected(row) THEN
This.SelectRow(row, False)
ELSE
This.SelectRow(row, True)
END IF
// single select
ELSE
IF This.IsSelected(row) THEN
This.SelectRow(0, False)
This.SelectRow(row, True)
ELSE
This.SelectRow(0, False)
This.SelectRow(row, True)
END IF
END IF

I;m pretty new in Powerbuilder use, so it's still hard to make it clear.

P.S. Please help! Urgent!
 
Try using powerbuilder datawindow EVENT IDs

Sample code for down arrow key to select a single row
-----------------------------------------------------
create a user event ue_key_down() and Assign event id pbm_dwnkey to it.(You will find this event id in the dropdown list)

this.selectrow(0, false)
this.selectrow(row,True)

Good luck



 
Hey,

Well the problem is with predefined ID it's not allow to make new argument and at that case these line this.selectrow(row,True)
will not work, because there is no row argument.
 
I meant it not working, but just selects all rows, where I need one by one.
 
Hey,

Thanks a lot for solution, that was pretty helpful, other guys just gave difficult advices how to solve it, but I knew that in the end everything will be pretty simplified.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top