1. Vipin Dwivedi
  2. PowerBuilder
  3. Wednesday, 28 September 2022 05:15 AM UTC

Hello Appeon Team,

What is the best way to enable/apply copy paste functionality from a datawindow grid screen for a column whose tab option is 0 or column is protected?

I can achieve this by making the field editable by setting edit tab to positive value and set the field as display only but this makes cursor enable when click the field.

Thanks

Vipin

Daryl Foster Accepted Answer Pending Moderation
  1. Thursday, 29 September 2022 00:36 AM UTC
  2. PowerBuilder
  3. # 1

I think if the tab order is 0 or the column is protected the column can't get focus so you won't be able to use the cursor inside the field to select a portion of the text.   In the past when I've need to do this, I have set a non zero tab order and not protected the column so the column can get focus, and then I've made the column Display Only under the Edit tab.  That way the column can still get focus, but the user can't modify it.

Comment
There are no comments made yet.
Heiko Betzler Accepted Answer Pending Moderation
  1. Wednesday, 28 September 2022 15:27 PM UTC
  2. PowerBuilder
  3. # 2

Hello Vipin,

we have the same requirement as you:

1. user clicks with right mouse button on a grid column
2. select "copy"
3. the value of the column should be in the windows clipboard
4. user can paste the value


This is the call stack of the code:
1. u_dw.rbuttonup
    HERE we are calling the code to get the value of the column
2. pfc_m_dw.m_copy.clicked
3. u_dw.pfc_copy

 

Best regards
Heiko

Comment
  1. Vipin Dwivedi
  2. Wednesday, 28 September 2022 20:28 PM UTC
I can get your code which is menu driven. I want functionality where when I hover mouse to the field whose data I want to copy, the cursor pointer gets change to beam and I can hold mouse button to select the text and either right click or use ctrl+C option to copy the highlighted text. The standard way to copy any content from normal application or web application.



Let me know if anyone has any idea for that. Do we have such property in datawindow?
  1. Helpful
There are no comments made yet.
Heiko Betzler Accepted Answer Pending Moderation
  1. Wednesday, 28 September 2022 07:06 AM UTC
  2. PowerBuilder
  3. # 3

Hello Vipin,

we've developed a dw-service to do this.

this is the code to get a value of a protected column (or a column with no taborder)

 


// 1st: check if column is protected/has no taborder

// if 1st = true then ...
ls_ColId = dw_grid.Describe(ls_RMBClickedColName + ".ID")
ls_ColId = "#" + ls_ColId
ls_Text4Clipboard = dw_grid.Describe("Evaluate('lookupdisplay(" + ls_ColId + ")', " + String(ll_SelectedRow) + ")")
....
Clipboard(ls_Text4Clipboard )

 

Best regards

Heiko

Comment
  1. Vipin Dwivedi
  2. Wednesday, 28 September 2022 12:22 PM UTC
From where you are calling this code?
  1. Helpful
  1. Vipin Dwivedi
  2. Wednesday, 28 September 2022 13:55 PM UTC
My requirement is to PB let me select the non editable field and I can then do the ctrl+C or right click and select copy option to copy the content into clipboard. So these functionality does require some mousemove and lbuttondown or lbutton hold even for me to cursor change to paragraph mode and let me select the content of the field like how we do onto static page or web page.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.