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!

Disable DataWindow, but allow to scroll

Status
Not open for further replies.

stannewyork

Programmer
Jul 15, 2015
4
US
Hello,

My business rules require to disable datawindow user status changes to 'DONE'. This is so that they can not make any more changes to the datawindow. I can easily do so by setting dw_2.enabled = FALSE.

However, doing so will also disable the scroll bar. We still want them to be able to scroll datawindow and see all the data.

Question, how can I disable the datawindow but still let them scroll and see all the records?

Thank you,
Stan.

 
You need to disable the columns which allow data entry. Set either the protect property to TRUE or the tab order to 0.

Matt

"Nature forges everything on the anvil of time"
 
Well that would be too much coding.

I found another option: dw_1.Object.DataWindow.ReadOnly='yes'

But it does not work. May be I use wrong syntax?

Thank you,
Stan.
 
If you don't want to explicitly spell out each column, you could loop through all and set their tab order through a modify like Matt suggested. Something like:

Long ll_COL

FOR ll_COL = 1 TO Long( dw_REF.Object.DataWindow.Column.Count )
dw_REF.Modify( "#" + String( ll_COL ) + ".TabOrder='0'" )
NEXT


// keep in mind, that's the general idea of the code... may not be 100% accurate syntax

 
It's not much coding if you put an extra column in your datawindow, use it in an expression on the Protect property of the columns you want to prevent entry, and then put code to set the value of the extra column once the user changes the status to 'DONE'.

Standard PB type stuff when working with datawindows...

Matt

"Nature forges everything on the anvil of time"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top