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!

Highlight row in dddw (datawindowchild)

Status
Not open for further replies.

JeroenP

Programmer
Mar 26, 2002
8
NL
Hi,

I've got a problem i can't figure out... hope someone can help me.

I've got 2 datawindows, both with a dddw inside.

If a choice is made in dddw1, dddw2 is being retrieved with argument of 1.

I want to insert an EMPTY row, because user does not have to select the second. And i want the empty row to be selected.

This code is being triggered on the itemchanged event of this first dropdowndatawindow.

Code:
string Ls_InstNaam, ls_empty
long ll_newrow

ls_empty = ''

datawindowchild dwc_inst1
datawindowchild dwc_Inst2

dw_instantie_naam_2.Reset()
dw_instantie_naam_1.getChild('instantie_instantie_naam_1', dwc_Inst1)

Ls_InstNaam = dwc_inst1.getItemString(dwc_inst1.getrow(), 'instantie_instantie_naam_1' )

// Not a null value
IF Ls_InstNaam <> &quot;&quot; THEN

dw_instantie_naam_2.getChild('instantie_instantie_naam_2', dwc_inst2)

dwc_Inst2.settrans(SQLCA)
dwc_inst2.Reset()
dwc_inst2.retrieve(Ls_InstNaam)

is_instantie_naam_1 = Ls_InstNaam

dw_instantie_naam_2.Retrieve(Ls_InstNaam)
dwc_Inst2.SetItem( dwc_Inst2.InsertRow(1), 'instantie_instantie_naam_2', ls_empty)

// The deselect and seelct part
dwc_inst2.SelectRow(0, FALSE)
dwc_inst2.Scrolltorow(1)
dwc_inst2.SelectRow(1, TRUE)
END IF

Now the empty row isn't (visualy) selected...
does anyone now the answer?
Using PB6.5
 

Could it be only that nothing *can* be visualy selected? Have you tried with ls_Empty = ' ' instead? So the spaces would be selected...

Hope it will help...


 
Nope not realy...
I can see the dddw (number 2) with the wrong row selected.

But if i click the 'downarrow' i see that te correct (the empty) is selected.

But it's just not shown in de dddw..

thnx for the suggestion.

To make a long story short:
----------------
| Value x____|\/ (it's blue (highlighted))
----------------

Then i pres dropDown \/

----------------
| some value |\/ (not blue)
----------------
|My empty value| (blue)
| Value x______| (not blue)

So it is selected i a weird way.. but not show in dddw...
 
Hi,

A DDDW has a row highlighted only when its parent dw's dddw-column value is set to its data-value. In other words, the &quot;first&quot; row that has the data-value is highlighted in the dddw. You need to set the parent-dw's column's value equal to the dddw's empty-row's data-value to solve your problem :~)

Regards,

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

Part and Inventory Search

Sponsor

Back
Top