I am embarrassed about this because it is very easy yet I cannot get this to work. I am sure I am overlooking something very obvious.
In Powerbuilder 2021, in a window I have a datawindow (dw_main) whose datasource has a dddw. On the open event of the window I run the following code. I traced the code and the return values are all good and 3 rows are retrieved with the datawindowchild yet the datawindow in the window is blank. I copied the code from other windows that are doing the same thing yet it does not work here.
datawindowchild ldwc_child
dw_main.Settransobject(SQLCA)
li_rtn = dw_main.Getchild("prj_nbr", ldwc_child)
li_rtn = ldwc_child.Settransobject(SQLCA)
ll_rtn = ldwc_child.Retrieve()
ldwc_child.Insertrow(0)
Any help will be greatly appreciated.
That worked! Gosh I am humbled and thankful at the same time!
Unless a data row is present (even a new/empty one), the DataWindow control cannot render the DW data object - so the DW control remains "blank". Same for the DataWindowChild... if it is empty (no data rows), then when the drop-down is opened the contents of the drop-down will be blank. Enabling the Auto-Retrieve property takes care of the frequent cases where the DataWindowChild does not utilize any retrieval arguments, so you do not to have to code it yourself.