{"id":31,"date":"2010-05-21T20:20:51","date_gmt":"2010-05-22T01:20:51","guid":{"rendered":"http:\/\/anvil-of-time.com\/2010\/05\/21\/powerbuilder-simple-windows-standard-row-selection\/"},"modified":"2021-03-08T19:16:11","modified_gmt":"2021-03-09T00:16:11","slug":"powerbuilder-simple-windows-standard-row-selection","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/powerbuilder-simple-windows-standard-row-selection\/","title":{"rendered":"PowerBuilder &#8211; Simple \u2018Windows Standard\u2019 Row Selection"},"content":{"rendered":"<p>Allowing for &#8216;Windows Standard&#8217; muli row selection is pretty straight forward.&nbsp; By &#8216;Windows Standard&#8217; I mean you can select a range by clicking on a row, holding the shift key and clicking on a second row to select all the rows between the two or by holding down the control key and clicking you can select multiple rows (or unselect one previously selected without unselecting all the others).&nbsp; Anyway the code is in the clicked event of the datawindow.<\/p>\n<pre name=\"code\" class=\"VB\">ll_selectedrow = getselectedrow(0)\n\/\/ select range\nIF KeyDown(keyShift!) THEN\n   IF ll_selectedrow = 0 THEN\n      This.SelectRow(row, True)\n   ELSE\n      This.SelectRow(0, False)\n      IF row &gt; ll_selectedrow THEN\n         FOR ll_rc = ll_selectedrow TO row\n           This.SelectRow(ll_rc, True)\n         NEXT\n      ELSE\n         FOR ll_rc = row TO ll_selectedrow\n            This.SelectRow(ll_rc, True)\n         NEXT\n      END IF\n   END IF\n\/\/ multi select\nELSEIF KeyDown(keyControl!) THEN\n   IF This.IsSelected(row) THEN\n      This.SelectRow(row, False)\n   ELSE\n      This.SelectRow(row, True)\n   END IF\n\/\/ single select\nELSE\n   IF This.IsSelected(row) THEN\n      This.SelectRow(0, False)\n      This.SelectRow(row, True)\n   ELSE\n      This.SelectRow(0, False)\n      This.SelectRow(row, True)\n   END IF\nEND IF<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Allowing for &#8216;Windows Standard&#8217; muli row selection is pretty straight forward.&nbsp; By &#8216;Windows Standard&#8217; I mean you can select a range by clicking on a row, holding the shift key and clicking on a second row to select all the rows between the two or by holding down the control key and clicking you can&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,10],"tags":[21,12,16],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/31"}],"collection":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/comments?post=31"}],"version-history":[{"count":7,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/31\/revisions"}],"predecessor-version":[{"id":1734,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/31\/revisions\/1734"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}