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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powerbuilder 9 - Child dropdown datawindow

Status
Not open for further replies.

getjbb

MIS
Jun 4, 2003
139
US
I have a datawindow control which holds a datawindow which has a style type of Drop Down DW. When the window open I would like to have the datawindow control populate with the field value of the first row. All I get is a blank.

The following statements suppose to be doing what I want:

li_return_code = idw_child_CB_Set.ScrollToRow(ll_rowfound)
li_return_code = idw_child_CB_Set.SelectRow(0, FALSE)
li_return_code = idw_child_CB_Set.SelectRow(ll_rowfound, TRUE)

If anyone can help me I will appreciate it
 
getjbb,

Try the following code and see what happens.

idw_child_CB_Set.InsertRow(0)
idw_child_CB_Set.SelectRow(0,FALSE)
idw_child_CB_Set.SetRow(1)
idw_child_CB_Set.SelectRow(1,TRUE)

By inserting a row into the datawindow and then setting the row, you should be able to have the row display the first row in the drop down list when you open the window.

Daniel Sellers
 
GetJbb,

You need to set the column value on the main DW to be the value of the first row in the DDDW. Try this:

///////////////////////////////////////////////////////

dataWindowChild ldwc
string ls_Value
//
IF dw.GetChild( &quot;<dddw-column>&quot;, ldwc ) = 1 THEN
//
ls_Value = ldwc.GetItemString( 1, <&quot;data-column&quot;> )
dw.SetItem( dw.GetRow(), &quot;<dddw-column>&quot;, ls_Value )
//
END IF

///////////////////////////////////////////////////////

The above code automatically sets the value of the main DW to be the value of the first row in the DDDW and selects the first row in the dddw when you drop it down.

---
PowerObject!
-----------------------------------------
PowerBuilder / PFC Developers' Group
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top