I have a webcombo on a webform (not in a grid). I set the datasource to a datatable in the InitializeDataSource event. With EnableXMLHttp turned OFF I can successfully set my selected value (from a businessobject) in the DataBound event of the combo and it displays correctly. With EnableXMLHttp turned ON this does not work unless the value selected happens to be one of the first rows in the combo. How can I force a row to be selected when the control has yet to load it due to the enablexmlhttp setting? I have a combo with 300+ rows and need to show the value that was previously selected and saved to the database.
Thank you,
Heather
private _data as datatable (loaded elsewhere in code)
protected sub capturevehiclecombo_initializedatasource()
capturevehiclecombo.datakeyfield="vehicleid"
capturevehiclecombo.datasource = me.currsess.db.getvehicles()
end sub
protected sub capturevehiclecombo_databound()
dim val as object = _data.rows(0)("capturevehicleid")
If Not IsDBNull(val) Then
If Not cell Is Nothing Then
capturevehiclecombo.SelectedIndex = cell.Row.Index
End If
End Sub
With EnableXMLHttp set to True the FindByValue returns nothing unless the value happens to be in the first set of rows loaded. With EnableXMLHttp set to False it works.
Hello,
Can you give the exact source code you're using ?
Give as much information as you can, so others can reproduce the problem
Has no one else has this problem? The page/combobox load time without EnableXMLHttp is very user-unfriendly but I cannot get my initial value selected with it off.