Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Powerbuilder Select rows with keyboard

Posted on 2011-04-20
Medium Priority
Last Modified: 2013-12-26

I'm looking solution how to select rows without mouse, using keyShift!, keyDownArrow! and KeyUpArrow! With my code it selects all rows, but I need figured out how to select rows one by one. My code:

long row, ll_selectedrow, ll_rc

If KeyDown (KeyShift!) AND KeyDown (KeyDownArrow!) Then
ll_selectedrow = getselectedrow(0)  
IF ll_selectedrow = 0 THEN  
      Row = Long( dw_kst.Object.DataWindow.FirstRowOnPage )
      This.SelectRow(row, False)  
      IF row > ll_selectedrow THEN  
         FOR  ll_rc = ll_selectedrow TO row  
           This.SelectRow(ll_rc, True)  
         FOR ll_rc = row TO  ll_selectedrow
            This.SelectRow(ll_rc, True)  
      END IF  
   END IF         
Question by:merovingen
LVL 14

Accepted Solution

sandeep_patel earned 500 total points
ID: 35441220
It depends where you write the code and other code available to select and unselect row. In your code second for loop starts with zero and hence This.SelectRow(ll_rc, True) sets all rows selected.

If I write a code in rowfocuschanged event it will be simple as below (assuming datawindow clicked event has code to select the clicked row)

If KeyDown (KeyShift!) AND ( KeyDown (KeyDownArrow!) OR KeyDown(KeyUpArrow!)) Then
End If


Author Closing Comment

ID: 35458858
Thank you very much. Solution was pretty helpful. I'm new in Powerbuilder and sometimes really hard for understanding where to write script.

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question