PRB: Setting a Default Value in a Client Listbox DTC (194017)
The information in this article applies to:
- Microsoft Visual InterDev 6.0
This article was previously published under Q194017 SYMPTOMS
When you attempt to set a default (selected) value of a Listbox Design-time
control (DTC) with the Scripting Platform set to "Client (IE 4.0 DHTML)"
and the Row Source set to a Recordset DTC with the Scripting Platform set
to "Client (IE 4.0 DHTML)", no default value is set when you use the
following code in the Window_onload or Recordset1_ondatasetcomplete events:
Listbox1.selectedIndex = 0;
-or-
Listbox1.selectByText("text");
RESOLUTION
To set a default value in the Window_onload event you must use the
following code:
Recordset1.advise(RS_ONDATASETCOMPLETE, "Listbox1.selectedIndex=0");
-or-
Recordset1.advise(RS_ONDATASETCOMPLETE, "Listbox1.selectByText('text')");
This defers selection of an item until after the Listbox DTC is initialized
by the Recordset DTC.
STATUS
Microsoft is researching this problem and will post new information here in
the Microsoft Knowledge Base as it becomes available.
Modification Type: | Minor | Last Reviewed: | 3/16/2005 |
---|
Keywords: | kbCtrl kbide kbprb KB194017 |
---|
|