NULLify field with not-editable DDDW

Link to this posting

Postby Ursego » 16 Jun 2017, 13:39

How to allow user to delete current selection in a not-editable DDDW using the Delete key:

1. Create a user event in the datawindow control mapped to pbm_dwnkey.
2. Put the following code in the event:

Code: Select all
Dscr:         Allows user to delete current selection in not-editable DDDW using Delete key
Developer:   Michael Zuskin - LinkedIn:
string   ls_col_name
string   ls_null
long      ll_null
long      ll_row

if key <> KeyDelete! then return

ll_row = this.GetRow()
if ll_row < 1 then return

ls_col_name = this.GetColumnName()
if IsNull(ls_col_name) or ls_col_name = '' then return

if this.Describe(ls_col_name + ".Edit.Style") <> 'dddw' or this.describe(ls_col_name + ".DDDW.NilIsNull") <> 'yes' then return

if Left(this.Describe(ls_col_name + ".coltype"), 4) = 'char' then
   this.SetItem(ll_row, ls_col_name, ls_null)
   this.SetItem(ll_row, ls_col_name, ll_null)
end if

return 0
User avatar
Site Admin
Posts: 120
Joined: 19 Feb 2013, 20:33

IF you want to ((lose weight) OR (have unbelievable (brain function AND mental clarity))) THEN click:

free counters

eXTReMe Tracker