Listing 1
String ls_modify
DataWindowChild ldcw_child

String ls_column_name = "dept_id_1"

ls_modify = ls_column_name + ".DDDW.DataColumn='dept_id' " + &
ls_column_name + ".DDDW.DisplayColumn='dept_name' " + &
ls_column_name + ".DDDW.UseAsBorder=Yes " + &
ls_column_name + ".DDDW.AllowEdit=Yes " + &
ls_column_name + ".DDDW.VScrollBar=Yes " + &
ls_column_name + ".DDDW.AutoHScroll=Yes " + &
ls_column_name + ".DDDW.Name='d_dddw_dept'" // DDDW

// attach the DDDW to the parent DataWindow
if (dw_1.Modify (ls_modify) <> "") then return -1

dw_1.GetChild (ls_column_name, ldcw_child)
ldcw_child.SetTransObject (SQLCA)
ldcw_child.Retrieve ()

Listing 2
DataWindowChild ldcw_child
String ls_curr_value

DataWindowChild dwc;

integer rtncode;

dw_1.GetChild("dept_id", ldcw_child)

ldcw_child.SetTransObject(SQLCA)
ldcw_child.Retrieve( )

ldcw_child.SetFilter("")
ldcw_child.Filter()

ldcw_child.SetDetailHeight(1, ldcw_child.RowCount(), 72)

ls_curr_value = String(dw_1.GetItemNumber(dw_1.GetRow(), "dept_id"))
ldcw_child.SetFilter("dept_id <> " + ls_curr_value)
ldcw_child.Filter()

ldcw_child.SetDetailHeight(1, ldcw_child.RowCount(), 0)

ldcw_child.SetFilter("")
ldcw_child.Filter()

Listing 3
// map event to pbm_dwndropdown via "User Events" dialog 
event ue_dwndropdown; 
// Might check if right column
ib_Dropped = True // Set boolean instance variable

// map event to pbm_ncpaint
event ue_ncpaint; 
If ib_Dropped Then
// Put code to execute when DDDW is closed here
...
ib_Dropped = False
End If

Additional Code for this Article